Automatically unref all lua created resources when a script is unloaded.