gluster: Added null check at couple of places

Change-Id: If3c14530af6a1774274ebb537dcf14cda37c70e6
Signed-off-by: Shireesh Anjal <anjalshireesh@gmail.com>