Return correct return code to avoid SEGV when a socket create fails.