Added finalizer which logs and closes unclosed connections