avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()