Fix deadlock bug when mkFastStringWith is duplicated
In D5211, we use withMVar to guard writes to the same segment, this
is unsafe to be duplicated. It can lead to deadlock if it is only run
partially and putMVar is not called after takeMVar.
We used to see deadlock when building stackage without this fix, and it
no longer happens.
Reviewers: simonmar, bgamari
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5349