Deadlock issue with slaves on Windows

There was a problem with the logger trying to write to a closed stream. The error occures if we have several threads trying to write the output from the screen as well as when a slave has been running for a longer period with a lot of output.

http://jenkins.361315.n4.nabble.com/deadlocked-slave-jar-patch-pull-request-tc4650249.html