synctask: implement setuid-like SYNCTASK_SETID()

synctasks can now call SYNCTASK_SETID(uid,gid) to set the effective
uid/gid of the frame with which the FOP will be performed.

Once called, the uid/gid is set either till the end of the synctask
or till the next call of SYNCTASK_SETID()

Back-porting Avati's patch http://review.gluster.org/#change,4269

BUG: 884597
Change-Id: Id0569da4bb8959636881457217fe004bf30c5b9d
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4611
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
cluster/distribute: Reopen fds in migration internally as root:root

Though linkfile_create and rebalance dst file create sent a setattr
with correct ownership, there is still a race window where the linkfile
open (client open due to migration) will fail, as its ownership will be
root:root.

BUG: 884597
Change-Id: Iba73681eae4f280d39ee6c9a40009e195768bee7
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4612
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>