Make sure callbacks aren't garbage collected

This fixes random crashes with GnuTLS.