Certificate tasks that are waiting for a CA to generate certificates were not being retried. This CR fixes that bug, introduced as part of properly handling exceptions raised during the worker service processes. This CR also beefs up unit testing around this issue so that this issue is not re-introduced later. Change-Id: I0a506c67be7881cf8c781c534f332f1f8122161e Closes-Bug: #1460873