Fix get_core_register_section leak, introduce thread_section_name