libev migration - add shutdown handlers