MDL-38041 behat: Adding hook

Stops execution when the output contains
an exception, a debugging message or a PHP
debug message.
MDL-38041 behat: Capturing also PHP debug messages