Don't save an unchanged file just to fire a callback

Separate the early exit logic from the checking of the callback,
and fire the callback even when we can exit early. This avoids not
one, but two backend calls which we don't need to make when there
are no changes (since file/put always triggers a file/compat-tree).

Change-Id: I6eb8e6f95e16eace277731e2c56d25d591f66559