Union reaches agreement with Volkswagen to avoid plant closures