Handle "not master" / "recovering" errors from writes

JAVA-1274
Added protocol methods to Connection so that operations no longer have to construct instances of Protocol directly.
Introduced ConnectionFactory interface to make it possible to unit test DefaultServer exception handling

 JAVA-1510