Make IORef usage compatible with base-4.5.x