Fix the foreign key error that occurs when you try to destroy content views
that have systems by adding a before_destroy hook. Fixes #3287.