Fix lazy evaluation and criteria w/ n-n.

If a base document was destroyed, and hence frozen, and we asked for a
count on it's many to many relation, the foreign key would be nil
instead of [] if the default had not been lazy evaluated. We now check
for nil and set to [] on the criteria only.

[ fix #2812 ]