TIFFWriteEncodedStrip/TIFFWriteEncodedTile: fix rewriting of LZW-compressed data
Fixes https://github.com/OSGeo/gdal/issues/1439
When rewriting a LZW tile/strip whose existing size is very close to a multiple of 1024 bytes (and larger than 8192 bytes) with compressed data that is larger, the new data was not placed at the end of the file, causing corruption.