Replace references to lock_guard to boost::lock_guard to fix compilation problems on OS X 10.9. Fixes issue #906.