Fix for bug in C++ timing utils

Tom found some bugs in the timing utils in Mac OS X and fixed them.
Quick summary of the problem:

The platforms gettime function returns a struct containing seconds and
either micro or nano seconds since epoch (the magic unix time start
thing from 1970-something). We save the starttime, and then later take
the endtime and calculate the difference. If endtime.nanoseconds <
starttime.nanoseconds then when the subtraction happens there is an
overflow of the arithmetic which causes bad things to happen. Also, the
scaling wasn't quite right when adding the seconds to the nanoseconds.