Measurement of isolated photon production in deep-inelastic scattering at HERA