Fixed segfault in curve_selftest function curve_server