MIN Fix error messages

libtiff errors can be both in reading or writing.
BUG Fix possible crash with TIFF

If the first libtiff operation was open a bad file, it'd crash as
TIFFSetErrorHandler had not been called.