check result of _open_osfhandle for any issues before returning it