Fix handle closing in windowsprocessdevice
INVALID_HANDLE_VALUE is not null so better to check for this, too. This also fixes CloseHandle calls on the wrong handles.
GnuPG-Bug-Id: T4332