Clear worker state upon shutdown, fixes #1764