[Haskell] Optimizing locking with MVars