Merge change 23983 into eclair

* changes:
  If an error occurs when creating a socket, don't call any more JNI methods (thus causing a segfault) but return immediately.