Port Bart Milne's work to 1.5
See: https://xp-dev.com/hg/libopenjpeg-dev/raw-rev/4e7218730b9c
Whitespace and dos2unix cleanup of opj_malloc.h