HDFS-2856: refactoring of SASL callback code to prepare for adding code for new SASL handshake.