Fix: Crash when state file is invalid.

Fixes #5361
Fix: PROCESS_HOST_CHECK_RESULT misinterprets the given status code.

Fixes #5462