Bug 838416 - Defend against insane clocks.

I haven't manually tested this, but it does now have some tests…