Resolve #42

It looks like there's no more endless loop with powerline while running the emacs daemon.

Added a test for `get-buffer-window` after `window-system` line 123.