Reducing the impact of weak-lensing errors on gravitational-wave standard sirens