Avoid extra filesystem access getting branch name

Avoid unnecessary filesystem access when getting the branch name by
using the file_watcher module. This way on systems with inotify there is
no filesystem access at all unless the branch config actually changes.
On systems without inotify, instead of opening the file and reading the
config, only a stat call is done.