Check for vim being in the foreground (linux/osx compatible)