Propagate connection initialization problems

When connection failed to open, it used to not tell it to the caller.
With this patch it propagates the error to the caller (like it used to
be in 0.2), and closes the orphaned connections (which is a new
feature).

This patch also makes basic tests pass again.