Canada, EU reach last-minute free-trade deal