Stop worker if connection is closed