Fix EZP-22419: Clearing cache in CLI when eZ Publish is not yet installed leads to database error

https://jira.ez.no/browse/EZP-22419

Blocks Behat tests. See https://github.com/ezsystems/ezpublish-community/pull/115