Fixed memory leak in test_keygen.c