static imports for brevity
doc improvement
Can't invoke the body if the step has already completed.
doc improvement
Explaining why syncMode doesn't do anything
Tightening up the error handling
Inlined methods that are only used from one place
If the body has completed synchronously, isLaunched() should return true
Prevent double launching
Merge commit '4076fe3d6c009182739f2e8c98675eb177c656c2'
[JENKINS-25504]

The previous attempt failed because CpsStepContext can get duplicated because of persistence.

This is a weaker fix that only waits for the "primary" body execution. That is, this doesn't work correctly if a Step is like parallel step that executes multiple bodies at the same time.

That said, the current ParallelStep implementation never reports itself completed until all the bodies check in, so this code should work correctly with all the known Step impls.
Making Findbugs happy
Explaining when this can be null.
Making Findbugs happy