tests: fix exception handling around vapi.connect()/.disconnect()