3.0 countercache

ref #4797 

This fixes the counter cache not being updated when the belongsTo association field is modified.
It introduces a `_oldProperties` to Entities and allow to freeze all properties value when saving.