It’s both of them. It’s John steeling himself up for what everyone knows Sherlock wants to confess, going still and stoic and shutting down emotionally like only John Watson can do.
It’s Sherlock noticing John’s distress and being unable to say it out loud. It’s two men very very afraid of giving this thing definition and not being allowed to pursue it completely. One thinks he’s off to die, the other has made a bed and decided to lie in it.
And Sherlock says nothing because if you don’t say it out loud, then there is some sort of self-preservation to it all.