HDFS-7266. HDFS Peercache enabled check should not lock on object (awang via cmccabe)
(cherry picked from commit 4799570dfdb7987c2ac39716143341e9a3d9b7d2)