Abundance profiles of CH3OH and H2CO toward massive young stars as tests of gas-grain chemical models