link_secondary_device in presage clears the current registration. This function happens to be called by gurk in ensure_linked_device when presage::Manager::load_registered fails. This happened to me when register_pre_keys failed due to a flaky network connection.
How about asking for confirmation in ensure_linked_device before attempting to relink?