Fixed a crash from calling libjpeg functions on the same data from two threads, but introduced a hang due to blocking on select