Add x509if_frame_end() which is passed to register_frame_end_routine() and which resets our global variables. Remove a boolean which was used to track a char *; just check if the pointer is NULL instead. Fixes bugs 5754 and 5793, hopefully without breaking anything.