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

Hackage database is now unified accross OS.