The first sentence is possible. It means that they were in the mental state of wanting to kill themselves, not that they actually had killed themselves. "to suicide" in the second sentence is wrong.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.