Mastercard profit beats estimates as lower costs soften spending hit