Clear worker state upon shutdown, fixes #1764
pipeline the shutdown