[dataimport] separate entities table from other metadata in SQLGenObjectStore
'entities' needs to be updated first as every other table has references
to its rows. Remove use of thread-local storage in the process.
related to #9177565.
usr/lib/python2*/*-packages/cubicweb/entities/
usr/lib/python2*/*-packages/cubicweb/ext/
usr/share/cubicweb/cubes/
usr/lib/python2*/*-packages/cubicweb/*.py