windows: Avoid crash if brickd waits for the user to press a key on exit

The console handler is still registered at this point but the log is not
available anymore. If the user clicks the close button of the command
prompt window then this event is send to the console handler which tries
to write about it to the log triggering a crash.

Avoid this by unregistering the console handler before exiting the log.