Backport the tests in ReentrantChannelTest

- Originally from c149f4bcc0c0d02aa1abcd5e39c155a9e598822e by @wgallagher