Fix NullPointerException from StreamHandler on failed execution.

On Windows CPPTasks Unit tests where failing for gcc.