Individuals with infections and hospitalized have an increased risk of dying by suicide, according to study.