Return error code for unhandled exceptions when running under ConsoleHost

This makes the behaviour consistent with the WindowsServiceHost