ec: Fix mutex related coverity scan issues

This patch solves 3 issues detected by coverity scan:

    CID1241484 Data race condition
    CID1241486 Data race condition
    CID1256173 Thread deadlock

With this patch, inode lock is never acquired inside a region locked
with fop->lock.

Change-Id: I35c4633efd1b68b9f72b42661fa7c728b1f52c6a
BUG: 1170254
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/9230
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>