Wait until a cache dump completes instead of waiting for a fixed amount of time
Dumping the cache is an asynchronous operation, so sleeping for a fixed
amount of time after running "rndc dumpdb" is imperfect as dumping cache
contents may take longer than expected on slower machines. Instead of
always sleeping for 1 second, wait until the "; Dump complete" line
appears in the dump or 10 seconds pass, whichever comes first.
(cherry picked from commit
2bbff06d3631653fcea95e223da47aea0f9cdf0b)
(cherry picked from commit
e617b915273730b340369be034f694ea1441fd41)