break up close_userdata into close_userdata and free_userdata