gfapi: fix for not able to rename folders

If oldname is being renamed to newname, we need to
check for type of newname only if newname exists.

Change-Id: I068a283f9ffe67fcd5e8754d6bf052a2339efbf2
BUG: 953694
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/5886
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>