When sharing I/O settings we dup the service's I/O handles then call
CreateProcess() to run the hook. However we didn't explicitly close the
duplicated handles, so the subsequent CloseHandle() called by
cleanup_loggers() would hang, as the logging thread's ReadFile() won't
have completed due to the duplicated handle still being a potential
writer.