Speed up vcs branch name and file status segments

Since the move to threaded vcs segments, the file status and branch name segments have become very slow. They cause input processing latency in vim and severe CPU/filesystem load. 

The fundamental reason for this is that we basically run the full vcs interface every 0.2 seconds just to do very simple things: get the current local branch name and check the vcs status of a single file. By writing our own algorithm for this, the process can be greatly speeded up. The algorithm is basically to use stat() calls to check if the relevant files have been modified since the last time, and only if they have been modified, to query the vcs system for the new status/new branch name.

On linux further speedup is done by avoiding stat() calls with inotify.

In the future a kqueue based backend to avoid stat on OSX can also be written. Though this is not something I am interested in personally. Even using stat() the segments are pretty fast now.