contrib: Cross platform fixes after recent commits

- provide a getment_r () version which behaves as
  re-entrant with some caveats for NetBSD/OSX specific.
- some apparent warning issues fixed, always use PRI* format
  specification avoid using %ld i.e not portable

Change-Id: Ib3d1a73b426e38b436b356355b97db0104a1a4a5
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7722
Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>