Correctly set errno when sockets API is enabled.