Check params before clearing dataStoreCache (GEOS-6575)

See https://jira.codehaus.org/browse/GEOS-6575 for discussion.

Initial review here https://github.com/geoserver/geoserver/pull/668
You might also want to add a test for sql views, there are tests using H2 stores in the code base for the purpose of messing with JDBC stores (see the WFS join tests for example)