Chinese e-commerce company JD.com has recorded its first quarterly profit since going public two years ago thanks to the integration of Walmart's Chinese web business and the growth of online shopping in the country.