Support running installed inside a directory that is a symlink.
isRunningInstalled() is made more reliable by resolving all symlinks contained
in the installation path.
Header inclusions were shuffled around to respect the best practice to include
from the more local to the more global headers and to solve a compilation error
as a result.. Fixes: https://bugs.launchpad.net/bugs/757288. Approved by .