HADOOP-6439. Fixes handling of deprecated keys to follow order in which keys are defined. Contributed by V.V.Chaitanya Krishna.