Use lua socket if available to time tests

This uses `socket.gettime` to time the tests if lua socket is installed. `os.clock` isn't very good because it (at least on my computer) doesn't have very good precision. Also, it keeps track of CPU time and not actual time elapsed, so it can be very wrong if your tests sleep.