Improve test to make sure it does not depend on append implementation details.
Fix data race by not appending to m.handlers but passing m.action instead to the context.