Fix #3658
Don't insist that handles be valid in _get_osfhandle