How do I prevent apps from blocking a second screen?
Try xPrivacy.

You might be able to limit the permissions of the all4 application you mentioned in such a way that it cannot tell if Google cast is running.

The Github page has the full options on what is available.