Fix panic with plugins and build commands

This fixes a bug in cargo where target executables and libraries would be linked
to plugin native dependencies (not wanted!).

Closes #885