Ellyse Perry took three wickets and held her nerve in a tense last over as Australia beat New Zealand by just three runs in a thrilling women's World Twenty20 final.