Replace LockGuard and LockGuardAdapter by a More General RAII Template

It turns out, that my `LockGuardAdapter` template was broken and relying on undefined behaviour. This totally gets rid of it and replaces the former `LockGuard` by a more general `RAII` wrapper class.