[GHC] #12892: Improve type safety in the RTS