Make saving and restoring of hidden threads work with overlays.