[trunk] replaced malloc with opj_malloc. (Fixes issue 368).