Support cleanup for specs that share read-only test data.

When you add things to the database in a `before(:all)` block, they
don't automatically get cleaned up because that block executes outside
of the DatabaseCleaner transaction. It's good that it executes outside
the transaction, because otherwise the data would be gone after the
first spec. However, it does mean that you need to indicate that
there's data to be cleaned up.

This commit adds a conditional hook for contexts that are annotated
`:shared_test_data`. This hook will truncate the database after all
the specs run.

Done to fix the specs for #3785. May also be applicable to #3996.