Improvement to merge_
Add a new memory test 'switch-memory.cpp'
Use some tricky intrusive_ptrs for pointing to listen_impl_func so we can
implement a more complex cleanup policy.
42 tests pass but switch still leaks memory.
All tests work and memory/switch-memory.cpp finally has a flat memory profile.
Remove dead code and fix event::add_cleanup() so it works correctly.