Close connection in tests