San Francisco courtroom clerks reach agreement over staffing, training issues