Measurement of R uds and R between 3.12 and 3.72 GeV at the KEDR detector