Fix another race: close conns before releasing lock