Include whole of <boost/thread.hpp>

Instead of including just <boost/thread/mutex.hpp> and
<boost/thread/lock_guard.hpp>. This makes it compatible with Boost
versions starting with at least 1.48 (installed on Travis-CI).