ENH Work around old libTIFF bug

In older libTIFFs, there is a logic bug which attempts to read a header
even when writing. This fix works around it.