When those things start to occur, it just means the cider is undergoing fermentation. It will taste more sour like vinegar, but it's by no means harmful. The cider just becomes unpleasant-tasting and slightly more alcoholic. It is not harmful.
If your cider is nearing its expiration, adapt this fall drink into creative recipes like sea salt apple cider caramels, boozy cocktails, or fall-flavored oatmeal. Go forth and drink your cider quickly.
Bring the juice to 160°F for a few minutes, then cool to 65°F before pitching yeast. Boiling the cider can be done but this changes the flavor and boils off water increasing sugars. Not all cider makers pasteurize or boil.
You can leave it in the bucket for 4-5 weeks if you want to. After that, you should move it to something more impermeable to O2. FWIW, I do a month or 2 primary fermentation for cider and then maybe 2-6 more in secondary before bottling.