Highly skilled foreigners are behind some of America’s most celebrated innovations. A new study suggests they drive down native workers’ wages, but benefit consumers overall.