Fixes #5582 - make the Kafo.exit_code set properly in post hooks