Save only dirty files on focus lost