Fix EntityContext operations on collections.

There were a few cases where EntityContext would hit a fatal error when
dealing with collections/arrays. This fixes that and also introduces
a minor optimization for array properties.
Merge pull request #2821 from cakephp/3.0-collection-context

Fix EntityContext operations on collections.