avoid re-entrancy into libtiff using the mutex api