Avoid reusing uids for kernel objects.

This makes logs easier to read: a uid is an X is an X.  Usually.
Still sequential, and if it runs out, falls back.
Merge pull request #1146 from unknownbrackets/kernel-uids

Avoid reusing uids for kernel objects.