How to to terminate runStmt in "GHC as a library"