postgresql: reduce concurrency insertion issues for directories
the idea is to prevent exceptions when 2 workers insert the same directory (actually the same directory entries) concurrently, which can happen quite a lot in replayer session.
This needs to be carefully inspected. Added tests look legit to me, but I need confirmation.
Edited by David Douard