Verify master status before retrying a socket
Verify master status before retrying a socket

If we cannot connect to a socket, first verify that we are
actually running on master before retrying. In this way, we
can report to the user quickly without adding additional
overhead to the intended use case.

Signed-off-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>
Reviewed-by: Helga Velroyen <2d0126b1ec6f9ec5cbec4a7012aa14faeaef10f5@google.com>

andir/ganeti,grnet/snf-ganeti,bitemyapp/ganeti,ganeti/ganeti,dimara/ganeti,leshchevds/ganeti,yiannist/ganeti,onponomarev/ganeti,ganeti/ganeti,onponomarev/ganeti,ganeti/ganeti,leshchevds/ganeti,yiannist/ganeti,andir/ganeti,andir/ganeti,mbakke/ganeti,mbakke/ganeti,bitemyapp/ganeti,leshchevds/ganeti,yiannist/ganeti,dimara/ganeti,grnet/snf-ganeti,mbakke/ganeti