lib: num_alloc: Add number allocator

If you for a specific application desire a certain number, unique within
a certain subsystem and preferably quick, this should be the allocator
to use.

Intended purposes for this allocator are:
 * process id allocation,
 * user id allocation and
 * device numbering

Other subsystems are also allowed to make use of this subsystem if this
reduces the necessity to duplicate code.

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>