libwinpr-synch: replace pthreads-based barrier implementation by interlocked operations + event and avoid deadlocks