Port jpeg_mem_dest for in-memory operations

 * Dependency for vendor code

https://github.com/CyanogenMod/android_external_jpeg/commit/f2124f30169390e8b766868642fef51541a9bd39

Change-Id: I635e0d53b2bfd884aea1faee81146da633bb56e9
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)