Thousands of flights grounded by computer glitch in US