openjp2 write method rewritten for exitstack support.  #45
Merge branch 'issue45' into devel