HDFS-7386. Replace check "port number < 1024" with shared isPrivilegedPort method. Contributed by Yongjun Zhang.

(cherry picked from commit 1925e2a4ae78ef4178393848b4d1d71b0f4a4709)