cluster/afr: Fix locking issues in entry self-heal

        Backport of: http://review.gluster.org/#/c/8837/

Original reporter of the bug & designer of the solution:
        Pranith Kumar K <pkarampu@redhat.com>

Change-Id: I6e36326e1d9398ede82166b358ab438367dd3011
BUG: 1136829
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8845
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>