Fix hold and release of a retrying task

Previously, on release, it will reset the task's state to `waiting`. Now it will reset back to `retrying`.

See also #355.