The globular cluster system mass–halo mass relation in the E-MOSAICS simulations