Improvement in mental health following total hip arthroplasty: the role of pain and function