gfapi: apply an upper bound on nested symlink resolution

In case of nested symlink resolution, implement an upper
bound on the number of such nested levels the resolver will
descend. This limit is arbitrary, and set to 2048 nested
levels.

Change-Id: I264e5bd60d317eda97f4e6f49bd5d8694f8664a9
BUG: 1004100
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5874
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>