Pretreatment of cellulosic or lignocellulosic material for subsequent enzymatic treatment or hydrolysis