I, frankly wouldn't worry about this when playing with a CD. The real objective is to learn the tune - changes, melody etc. Forget all the other things that, yes, could be done as mentioned above. These are just time wasters and a distraction to keep you from playing!!
If you can't initally 'hear' the ending coming you will eventually. Typically on playalongs there is a cue of some sort - perhaps as mentioned a change to what the rhythm section is playing when going into the final chorus or the drummer hitting a cue just before the last couple of bars. This is what would happen on a gig after all. But, it is a good idea to learn to count how many as you play along with the CD.