A megafarm that would have reared almost 900,000 chickens and pigs at any one time has been blocked by councillors in Norfolk over climate change and environmental concerns.