Add a regression test for the send wake-up on close (#1281)