Fix bugs in ray differentials with depth of field.

First reported by Kevin Chen years ago.
Fix partially based on code from 陈家挺.
Also issue #31.