refresh open files when spark gains focus

Check for deleted files and changed file contents when spark gains focus. Fixes #1689 fixes #1691.

@ussuri @dinhviethoa