Allow transformers-0.4
Switch to SafeSemaphore (QSem is deprecated in GHC 7.8)