Fixed no slave available error during HA elections

A slave will not go from SLAVE to PENDING if the newly selected master is the same as the old one.
This helps to prevent possible race during new instance joining the cluster and getting an available slave.