The Irish government should avoid a no-deal Brexit at all costs, says ex-prime minster Ahern.