Move register_shutdown_function