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
MDL-38041 behat: Also fail tests if there is any other backtrace