replicate: fix lock counting in blocking lock path

As of http://review.gluster.org/2828, the blocking lock code
path's condition for checking completion of locking atempt is
broken. The condition -

	if ((child_index == priv->child_count) || ...)

and

	if ((child_index == priv->child_count) && ...)

which is retained to check completion of blocking lock attempts
for DATA/METADATA transaction will _always_ fail because a few
lines above we have -

      child_index = cookie % priv->child_count;

So child_index will never equal priv->child_count. This leaves
the correctness at the mercy of the next part of the
conditional -

	.. (int_lock->lock_count == int_lock->lk_expected_count) ..

This "works" as long as no server went down during the transaction.

If a server goes down in the middle of the transaction, then this
condition also fails, and the code wraps around and starts a
blocking lock attempt loop all the way again from from the first server.
This results in double locks getting acquired on those servers, and
eventually the second condition gets hit (first condition is _never_
hit) and we come out of locking phase.

During unlock phase we perform only one unlock per server leaving the
other lock "leaked" forever.

Change-Id: I7189cdf3f70901b04647516fe1d1e189f36cc8dd
BUG: 765564
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4433
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>