Thread-safe implementation of RawLogger

A static mutex has been added to RawLogger to protect static variables
and ensure thread-safe behaviour.

Signed-off-by: Raffaele Aquilone <aquiloneraf@gmail.com>