set a 5min timeout on sockets

also no longer call BIO_free_all() since it calls exit() from nowhere