Upgrade libtiff to 4.0.7
This includes the cmake build system support that we had to add ourselves before. Minor fix required for mingw, but otherwise it's all happy.