Compatible with cabal-sandbox and cabal-dev

ghc-mod refers the package-db of cabal-sandbox or of cabal-dev if exists in the current or upper directory.