Fix some tiff crashes

The TIFF loader currently allocates 8 bytes per pixel, but TIFF files can use more than 8 bytes per pixel (e.g. with *bits per sample* = 64 and *samples per pixel* = 3, it's 24 bytes). In addition, no buffer size is passed to the TIFF read functions, hence buffer overflows are possible. See https://gist.github.com/Trundle/cd807b95a8bfa5532a8b/raw/a0ed0acf13026febaa6c0c7f980cb2104976d9ed/rgb_contig_64bpp.tif for a crasher file.