East Coast port strike averted as parties agree to last-minute deal