factor out try_suicide

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>