Locking of length scales in two-band superconductors