Write out ring.gz's in a safer fashion

Write the ring file to a temporary location first and then move it into
place. This should help prevent issues like reading a partial ring file
while a new instances is being written out.

Change-Id: I28357a2f038a51cb9d823822b92f736dff033a9e
Merge "Write out ring.gz's in a safer fashion"