Hackers with suspected links to China appear to have accessed sensitive data on US intelligence and military personnel, American officials say.