encode_jpeg: free unneeded memory before return
separate reading-framebuffer-data part into read_fb function
change to open framebuffer device only at read_fb_init and to close at read_fb_finalize
change to reuse retbuf memory area which is allocated by libjpeg at first jpeg_mem_dest call
change to free reused memory in encode_jpeg_finalize function