High pT charged pion and proton production in GeV Au + Au and d + Au collisions