prefer $XDG_RUNTIME_DIR for pid file and socket

According to the [XDG Base Directory Specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html), sockets and pid files should go into XDG_RUNTIME_DIR.