Use else rather than finally.

Using else rather than finally so that we only close the connection if
it's hypothetically still open (a non-closed connection exception was
raised).