add encode_png_finalize() (temporary version; must be fixed)
change child thread to encode PNG and parent process to receive the encoded image data
make encode_jpeg_core() void

this function originally fill the retbuf buffer which is source-file-global value
add static attributes to all source-file-global value
change to reuse retbuf memory area if possible and to free retbuf in encode_png_finalize()
add static attributes to all source-file-global value
fix to handle the return value from child thread