China avoids Olympic protests by banning foreign spectators