Use CAutoLocker for exception save locking

For some errors the unlock was not called. Using the constructor/destructor pattern prevents this.

Signed-off-by: Martin Strauß <MStrauss@MuellerBBM-vas.de>
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Deduplicate code

Signed-off-by: Martin Strauß <MStrauss@MuellerBBM-vas.de>
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Drop unused declaration

Signed-off-by: Martin Strauß <MStrauss@MuellerBBM-vas.de>
Signed-off-by: Sven Strickroth <email@cs-ware.de>