[master] assorted fixes for vampire macros

supersedes https://github.com/scala/scala/pull/2993

review @adriaanm @retronym @paulp