Fix authentication process for replica sets

The authentication is always done with the write protocol (on the primary), so while using read preferences on secondaries, the authentication is never done.