Fix 64-bit multipage tiff writing segfault