Revert "Catch and ignore CTRL_LOGOFF_EVENT when run as a windows service"

This reverts commit a7ddf81b37b578b1448f83b0efb4f7116de0c3fb.
Put console event handle in reachable code