include connectionState-check in IPConnection.Write(); this narrows the scope of the socketLock to the least neccessary scope and avoids Device.sendRequest*-methods to behave like foreign methods (access to many ipconnection internals)
remove socketWriterLock as it is only used inside IPConnection.Write() and it is now completely superseded by the socketLock
make generation of SequenceNumber thread-safe so it is not possible to have two consecutive equal numbers generated
simplified sequence-number code
sendRequestExpectResponse will in every  case set expectedResponse-values to zero
Merge pull request #32 from NobodysNightmare/csharp_improve_locking

C#: improve locking