Fix issues which sometimes prevente scheduling around live TV.

Backport of SHA1:b05ecd46 to fixes/0.26.

There are some cases where we don't attempt to schedule around live
TV.  This change cleans up the logic which determines when to do that
and fixes some of the bugs found in the process.

NB: the case where a user enters live TV immediately before a
recording is scheduled to start is still not handled gracefully.
Fixing that is a lot tougher and will likely mean involving the
scheduler in choosing which input to use for live TV.

Refs #11207