ioctl: Fix test failure on native Windows. * lib/ioctl.c: Include msvc-nothrow.h. (primary_ioctl): If fd is not a valid handle, set errno to EBADF.