Fixing thread segfault issues with new Boost 1.53

The answer was to use boost::move() on the functors, but since there is AFAIK no
move emulation support for Boost.Function, the fix may only work on C++11
compilers. That needs to be looked into.
Wrapping boost threads in scoped_ptr

Boost.Thread deprecated the copy ctor for threads; this is a better approach.