Activity logger reentrancy resilience and output multithread support

Add thread safe support on the output of the activitylogger and the ability to detect reentrancy on the activitylogger method.