Fix GHCi space leaks (#15111)

Authored by simonmar on May 1 2018, 10:52 AM.

Description

Fix GHCi space leaks (Trac #15111)

Summary:
There were a number of leaks causing previously loaded modules to be
retained after a new :load. This fixes enough leaks to get the
tests to pass from D4658.

Test Plan: See new tests in D4658

Reviewers: niteria, bgamari, simonpj, erikd

Subscribers: thomie, carter

GHC Trac Issues: Trac #15111

Differential Revision: https://phabricator.haskell.org/D4659