Relationship of depression and cognitive impairment to self-injury in borderline personality disorder, major depression, and schizophrenia