Set the closed handle to INVALID_HANDLE_VALUE to prevent later closing it again