Deaths by suicide and their relationship with general and psychiatric hospital discharge: 30-year record linkage study