Added Mutex + Locks to protect std::ostream