Absolute dimensions of eclipsing binaries. XXIX. The Am-type systems SW Canis Majoris and HW Canis Majoris