Work around a race condition in writing out grefs that already exist