porting jpeg_mem_src() from jpeg lib v8c

A new function jpeg_mem_src() is ported from jpeg lib v8c to
support decode/encode in memory.  The source code is coming from
merged of Change-Id: I4d7f81fbb9a9e0cecaadd1855fc9f34296ba3eae
http://www.ijg.org/files/jpegsrc.v8c.tar.gz

Change-Id: I0a2cb95dba6819802e0e5209f450728f5f9acc19