Add ObjectWithLockedConstruction mixin.

You can mix this into your class and implement lock_id to avoid race
conditions when multiple concurrent processes are trying to create the
same object. lock_id will be passed all params given to the constructor
and should return a string that is sufficient to uniquely identify the
object being created.