features/index: Perform closedir() in error paths to avoid fd leaks

Change-Id: I7c8fc22ebe3c9cdf88e803e27c645cbad0012d16
BUG: 1166275
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/9167
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>