HDFS-2856: bring in more of the SASL handshake logic.