glusterd: Fetching the txn_id before performing glusterd_op_bricks_select in glusterd_brick_op()

In glusterd_brick_op(), the txn_id mut be fetched before
failing the transaction for any other reason. Moving
the fetching of txn_id to the beginning of the function.

Also initializing txn_id to priv->global_txn_id where it
wasn't initialized.

Change-Id: I44d7daa444f00a626f24670c92324725f6c5fb35
BUG: 1102656
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7926
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>