CN, railworkers reach new deal avoiding potential strike