Rewrite some locks

Stop autosave ignoring autobackup is active.