HADOOP-10970. Cleanup KMS configuration keys. (wang)

(cherry picked from commit adf0b67a7104bd457b20c95ff78dd48753dcd699)
HDFS-7046. HA NN can NPE upon transition to active. Contributed by
Kihwal Lee.
(cherry picked from commit 9e355719653c5e7b48b601090634882e4f29a743)