fixed deadlock in eeg logging thread