convert pic_jpeg interface to pure Lua/FFI solution

pic_jpeg had a wrapper lib before that was needed because of the
libjpeg API which uses setjmp/longjmp error handling.
By using the TurboJPEG API that comes with libjpeg-turbo, we can
use a pure Lua/FFI based approach.
Merge pull request #265 from hwhw/master

convert pic_jpeg interface to pure Lua/FFI solution
fix off-by-one in writePNG() method
fix RGB16 to 8bit grayscale conversion
Merge pull request #266 from hwhw/master

Fixes for blitbuffer implementation