BIO_s_connect: add an error state and use it