Fix http segfault at exit