refs.c: introduce get_main_ref_store()