gluster: proper check in gfapi.py to avoid segfault in libgfapi

This patch adds proper checks in gfapi.py to avoid
segmentation fault in libgfapi.

Change-Id: I63da25817772ba887032aaa04f811215d931520e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1162640
Signed-off-by: ndarshan <dnarayan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35256
Reviewed-by: Bala.FA <barumuga@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35515
Tested-by: Bala.FA <barumuga@redhat.com>