Heterotic-string amplitudes at one loop: modular graph forms and relations to open strings