Fix broken max_retries logic
Fix broken max_retries logic

Previously, we were only breaking out of the nested for loop, but we
actually want to also break out of the "infinite" while loop too.

tdaede/rd_tool,tdaede/rd_tool