Master integrals for massless three-loop form factors: One-loop and two-loop insertions