jpeglsenc: Check memory allocations