Del Potro beats Federer at Flushing Meadows