CA-93557: Poor perfomance for VMs in 'Restart' vs 'Restart if possible'.

It was a side-effect of the fix for CA-57613.
This pull-request also include an optimization made for SCTX-1033.