[PDI-10503] Synchronize stream loggers

Synchronize stream logging threads with the thread they are called from.

Unit test isn't provided as the fix affects thread synchronization only.