improve getFree*ActiveObjectId to reduce common case cpu usage 

Sideeffect: object id's are reused as late as possible thus chance of id collision is due to threading errors is reduced too.