Move all rewrite flushing to shutdown, so it doesn't break other plugins who add their rewrites late.