Add interception function for time(), which simply checks the validity of the
output pointer (if non-NULL), and records any state changes.