#263 safer reconnect cycle with finally block