SOLR-5795: harden leader check to log cleanly (no NPE) in transient situations when there is no leader due to election in progress (merge r1584097)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x@1584099 13f79535-47bb-0310-9956-ffa450edef68