(Compares with estimates, adds details on result) July 18 (Reuters) - Canadian Pacific Railway Ltd reported a higher-than-expected quarterly profit on Wednesday as Canada's no.2 railroad operator was helped by higher shipments of commodities like grains and potash. CP said total carloads, the amount of freight loaded into freight cars during a specified period, rose…