Make a method to return or allocate the serial for a global.
When the global is unregistered, a new serial is calculated.
Place the serial in the object info and the global info.
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.
Patch generated with concinelle with a few manual fixes.