Merge pull request #786 from rouault/tier1_optimizations_multithreading