storage/replica: improve error handling for multiple errors

This patch adds a MultiError type which we return from methods dealing
with replica sets.  It also introduces a MaxFailures variable that
indicates how many failures are tolerated before an error return occurs.