Ensure that fileno() returns -1 when given an invalid file pointer.