Early death in those previously hospitalised for mental healthcare in Scotland: a nationwide cohort study, 1986–2010