[master] assorted fixes for vampire macros

Rebased version of https://github.com/scala/scala/pull/2902