Fix a bug in the dirty bit when not partial loading

This also ensures that the change tracking hook is buffer-local.