opj_j2k_write_sot(): fix potential write heap buffer overflow (#991)