Add test case for #8144.

Based on:
  https://github.com/nh2/ghc-bug-time-dependent-interface-hashes

I verified that this test fails for GHC 7.6.3 and older, and passes
for GHC 7.8 and newer.