Adding more check for valid window handles
Adding more check for valid window handles

Discovered while fixing https://github.com/MahApps/MahApps.Metro/issues/3944
punker76/Controlz,ControlzEx/ControlzEx