Autosave should load relation only when necessary

This makes the relation load on autosave happen only if there is changes on the doc or
in one of the autosave associations. [ Fixes #2862 ]