Fix the issue with niftiApplyCannonicalXform error for some datasets

This change will fix the issue of niftiApplyCannonicalXform throwing an error for some datasets with oblique prescriptions that are halfway between two canonical orientations. However, I haven't done extensive testing to be sure that this change doesn't break the transform computation for datasets where the old code worked well. (A few spot-checks suggests that it does indeed still do the right thing for other datsets.)