tdk: add optimization for union

According to the NetKAT laws:

  a | a = a

It'd be even better to push this down to the tdk library, but that will
require a bit of API design.