Add with-clean-shutdown macro