For the first time, scientists watched a dying star swallow a planet whole