Plan to turn historic Cheshire pub into homes is thrown out