[FAB-14944] Fix Data race in TestSend
[FAB-14944] Fix Data race in TestSend

The test has a data race because it re-programs a mock in
a non memory coherent (and wishful thinking) way, and the
goroutine that sends the messages isn't effected by
the mock synchronization attempts in the test, because
they happen after the data race occurs.

This change set fixes the data race by programming the stream's
mock only once, and having it dynamically read the returned values
while holding a lock, which synchronizes between the goroutine
that sends down the stream and the test goroutine.

Ran this 10,000 times with data race detector and it doesn't
fail now.

Change-Id: I8a0030586da9102e8539c9f7b8699c63c6565894
Signed-off-by: yacovm <632344b5da9bd743456189af4db4b56472defb8c@il.ibm.com>

jimthematrix/fabric,binhn/fabric,stemlending/fabric,binhn/fabric,hyperledger/fabric,manish-sethi/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric-sidedb,stemlending/fabric,hyperledger/fabric,manish-sethi/fabric-sidedb,muralisrini/fabric,muralisrini/fabric,manish-sethi/fabric-sidedb,stemlending/fabric,jimthematrix/fabric,manish-sethi/fabric-sidedb,muralisrini/fabric,binhn/fabric,manish-sethi/fabric-sidedb,stemlending/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric