The future of two historic country pubs has been protected after they were listed as community assets.