Resident physicians’ clinical training and error rate: the roles of autonomy, consultation, and familiarity with the literature