Fallback on xrandr to get linux DPI info.

xdpyinfo is not always available on Linux (even with a DE), whereas
xrandr is (AFAICT) at least dependency of KDE and XFCE.  But xrandr
fails when used remotely, so keep it too.
LGTM, but we also prefer not to nest functions :) Just move it outside and make it private (add an `_` prefix) and we should be good