Voters in Switzerland have rejected a referendum motion that would have put an end to factory farming in the country.