Added conditional compile instead of changing OniGrabber cast type.

Should prevent regression problems when using OpenNI 1.x.