Copy sock/in_stream/out_stream before checking for null

Fixes issue #98

If the connection has been closed then these fields may be null.
optimise RelayConnection read/write

Wait indefinitely for new outgoing messages instead of waking up
4 times a second.

Avoid making multiple copies of byte arrays when reading messages.
Revert "FIX #85"

This reverts commit 5a0b8f40f1762d74428a1aa9c554a503e0d14098.
Copy sock/in_stream/out_stream before checking for null

Fixes issue #98

If the connection has been closed then these fields may be null.
optimise RelayConnection read/write

Wait indefinitely for new outgoing messages instead of waking up
4 times a second.

Avoid making multiple copies of byte arrays when reading messages.
Merge branch 'sa-push' into sa