A dying star swallowing a giant planet hints at the fate awaiting our solar system some five billion years from now