vlib: fix access before check issue in foreach_vlib_main macro