Fix ghc-modi hanging in emacs

Use wrapProgram from makeWrapper to wrap ghc-mod and ghc-modi like
haddock. The wrapper code is clearer and hopefully more maintainable. As
a side-effect, the bug where emacs would hang while loading ghc-modi is
fixed.