Del Potro stuns Federer to seal semis spot