util: use HAVE_GETTIMEOFDAY where appropriate
configure.ac already defined HAVE_GETTIMEOFDAY, but the uses of gettimeofday()
weren't guarded by it. It obviously doesn't matter on any currently supported
platforms, but it will be needed for planned changes.