fix publish for modules where name matches core

Fixes https://github.com/npm/npm/issues/6589