Have a look at set_exit_callback()/pike_set_prog_event_callback().
They won't be called either when pike exits unless you've configured with --with-cleanup-on-exit. Arne needs to use add_exit_callback, or do something from the PIKE_MODULE_EXIT function, because iirc they are always called before exit, regardless of configure options.