YARN-2527. Fixed the potential NPE in ApplicationACLsManager and added test cases for it. Contributed by Benoy Antony.

(cherry picked from commit 1c93025a1b370db46e345161dbc15e03f829823f)