Mac OS X portability fixes

There is no value here in using clock_nanosleep() instead of nanosleep()
(except to get the accuracy, but that can be left as Linux-specific).
Add debug code to display the actual sample frequency