idr: relocate idr_for_each_entry() and reorganize id[r|a]_get_new()