Fix segfaults in libshogun GP examples