Make 'next' method of generator thread-safe

'get' of shared_stream_state poped elements from queue without lock.