Check proc's health before (un)docking. Fixes #5338
Merge pull request #5340 from obrakmann/fix5338

Check proc's health before (un)docking. Fixes #5338