skip teardown if cache has not been set up
Merge pull request #3796 from owncloud/gracefully_handle_teardown_in_scanner_test

skip teardown if cache has not been set up