Fix Hackage database path for OSX and extract `getHackagePath`.

Hackage database is now unified accross OS.

This fix: https://github.com/peti/hackage-db/issues/2

And I would love being able to reuse the `getHackagePath` function in my `codex` library ;-)