Fix 64-bit multipage tiff writing segfault

Quick fix for 64-bit multipage tiff writing segfault.