A Chinese company’s preliminary agreement to invest in A123 Systems Inc. has ignited concerns that China could take control of the struggling Waltham battery maker’s advanced technology and spurred new criticisms by Republicans that the Obama administration squandered billions in stimulus money with investments in risky firms.