Catch additional errors to prevent warnings logged when connections
are closed immediately after opening.

Closes #750.