YARN-2753. Fixed a bunch of bugs in the NodeLabelsManager classes. Contributed by Zhihai xu.

(cherry picked from commit 4cfd5bc7c18bb9a828f573b5c4d2b13fa28e732a)