reorder the checks in check_if_fd so the argtype check is first.