Patient and service-level factors affecting length of inpatient stay in an acute mental health service: a retrospective case cohort study