Enable do-until to fail on max retries completed scenario

This pr would make the task fail if the max retries is exhausted in do until loop.