Fixed problem that $len would not be defined when an execption occured during writing

Example stacktrace: 
...
at peer.BSDSocket::write() [line 415 of BSDSocket.class.php] Undefined variable: len