libosmscout/osm_searchdb: cleanups and added duplicate object checks