Oxide formation at the surface of late 4d transition metals: insights from first-principles atomistic thermodynamics