A Jeremy Kyle Show guest who died after filming an episode of the programme had spoken to medics about having suicidal thoughts in the weeks beforehand, an inquest has been told.