Code refactoring in peer-utils based on review comments

https://review.gluster.org/#/c/8238/2/xlators/mgmt/glusterd/src/glusterd-peer-utils.c

Change-Id: Ia2a3eee649f5617902bb75496471c3eed75e2d5d
More fixes to review comments

Change-Id: Ibc59aab629e5bf7207e1cac1cadcd9c44fe99b8f