merge YARN-848 from trunk. Fix NodeManager to register with RM using the fully qualified hostname. Contributed by Hitesh Shah.