Error check in Socket::open() + cleanup