mjpeg_stopthread() now cancels blocking operations before joining to the thread.
This causes mjpeg_stopthread() to exit without delay, instead of blocking on
blocked socket operations. pthread and win32 threading in mjpegrx were
wrapped into a pthread-like interface. A few other minor bugs were also fixed.