China's Tencent Holdings has bought a 5 percent stake in U.S. electric car maker Tesla for $1.78 billion.