envoyd: add safe_asprintf helper