xfs_io: test for invalid -Tr flag combination before open
Coverity spotted this.
It complained that we didn't close the fd before returning in
the error case of incompatible options, but in reality, we wouldn't
have gotten that far because open(O_RDONLY|O_TMPFILE) would be
rejected with EINVAL.
So the error handling test would never actually be true.
Fix this by moving the error checking prior to the open so
the user gets a more useful error message than "Invalid Argument."
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>