The M/G/1 queue with alternating service formulated as a Riemann-Hilbert problem