Catch AssertionError when connecting to sockets.

Annoyingly this is thrown on Android when libcore.io.Posix.getsockname() throws libcore.io.ErrnoException, rather than just an IOException.