Ensure onexit callback is running in a fiber