Fix concurrency bug in FlatMapOp.next() introduced in commit 8b36ff6 + add better test