Fix memory leak by calling CloseHandle (lib, win)