common: Generate unique serial number for each key.

This is not guaranteed to be unique, but should be good enough.