Segfault when doing hs_init()/hs_exit() multiple times