Data corruption using SslStream (Xamarin bug 15293)

When reading and writing data at the same time over an
System.Net.Security.SslStream, an exception will be thrown often.
Usually the exception is: Mono.Security.Protocol.Tls.TlsException “Bad
record MAC”

The issue is that the single TlsCipherSuite instance used for both
reading and writing does not synchronize access to the “header” member.
If the contents get corrupted the MAC calculation returned by
ComputServerRecordMAC or ComputeClientRecordMAC is incorrect.

See https://bugzilla.xamarin.com/show_bug.cgi?id=15293. Reproduced in
OS X, iOS and Windows.
Merge pull request #929 from edbprx/master

Data corruption using SslStream (Xamarin bug 15293)