reviewed implementation

to get rid of some race conditions which were triggering (minor) leaks
under certain circumstances of high concurrency
test both directions

OUT <- |-------| <- IN
and
IN  -> |-------| -> OUT
go back to 10000 for testing

this value was increased while debugging but it's not necessary and
slows down test execution time quite considerably