implement locking properly with std::mutex and std::lock_guard<>
C++11 migration:

- use lambda functions instead of binding member functions
- replace boost::mutex by STLs <mutex>
- reformat according to new guidelines
remove superflous includes
use nullptr instead of NULL
use proper types instead of implicit casts
refactor list of const static int into scoped enum