Correctly the check the ioctl exit code