Use F_CLOSEM if available

Use F_CLOSEM to close all file descriptors if available.

Backport of Ib3c682825b89c163ebb152848f2533b3cb62cdce

BUG: 1138897
Change-Id: Ie44c8e07c77ca5509766e0addbb17c1979df68e7
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9010
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>