Unload scripts before sending quit command