A European court has upheld a partial ban on three insecticides, saying the European Commission had been right to restrict their use to protect bees.