jpeg2000dec: cleanup properly after decoding errors

Fixes memory leak in fate-redcode-demux.
jpeg2000dec: initialize static data just once