Check params before clearing dataStoreCache (GEOS-6575)

See https://jira.codehaus.org/browse/GEOS-6575 for discussion.