Use clock_gettime() to fake ftime() and time()

Also implement apple_clock_gettime() based on Wolfgang Hommel's idea.