Clean up hanging promises left by middleware_spec