[persistentcontainer] make sure the correct container is chosen if the type is a const Grid
[test] slightly extend the persistent container test for const Grid type