AB de Villiers resists call of nature to score hundred