gns.zclient.get_context(): using try/finally to close the client on exception