For decades, the U.S. has welcomed the flow of foreign capital into the country. But two tax measures nestled into President Trump’s spending package could change that.