lib: fix segfault on mac when retrieving version before init()