CreateEvent/CreateThread use null for invalid handles, not INVALID_HANDLE_VALUE.

INVALID_HANDLE_VALUE is used for file handles for example.
Fix reseting the device when in capture mode.

The playback was stop when switching user for example.