David Warner's first international century since his ball-tampering ban helped Australia to a 41-run win over Pakistan at the ICC World Cup.