US fastfood giant McDonald's has reported a rise in quarterly net profit despite increased competition and a slowing global economy.