Clean up compilation warnings

Also avoid defining unprefixed subr-x functions when they do not exist,
use a package-prefixed version instead.