Djokovic beats Del Potro to win Shanghai title