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: Ibbc86ae6d5d041b7018b640395f8c7399de76acb
(cherry picked from commit 3edaa89c4d9fa58d41d1619e943432fc1c06a090)
(cherry picked from commit 4c0e0cf6ebc1e26ed2df41ae0a1f13a25c6f28b1)
(cherry picked from commit 74cb9beac8ec680bde81fd4f8a36bfdc00b72355)