Prevent subsequent hooks from being called if we are `--bail`ing.

Clean version of #835 .