Use CLOCK_MONOTONIC instead of CLOCK_REALTIME

This prevents problems when the clock is jumping around which can happen
when NTP starts or in a misconfigured environment with multiple NTP
servers that are out of sync.

Closes #14