fix NPE in DiffCounter
Fix race condition in osm history import.

Problem was inserting into the worktree with more than one thread at a time.
This fix is just not using multiple threads in osm history import, and improved
performance by using the bulk insert/delete methods in WorkTree instead of the
individual feature ones so that there are less root trees created and WORK_HEAD updates.
The issue with WorkTree not being thread safe remains but that's a separate one.