read-cache: don't write index twice if we can't write shared index