Fix hold and release of a retrying task

Previously, on release, it will reset the task's state to `waiting`.
Merge pull request #1268 from matthewrmshin/fix-hold-release-retry

Fix hold and release of a retrying task