OK. I finally stopped using this "lame" yml method of removing the canonical link and wrote a simple Discourse plugin for this task:
yml method