And now, on to the embarrassing string-pool reimplementation bugs, take I

- String pool offset resize was off by one, oops
- String pool data-area resize requires rehashing all the strings,
  as the key pointers change. Ouch. Should be avoidable by extending
  rpmhash to allow passing the pool itself around in comparisons as "self"
  and using offsets as keys, but for now working counts more than speed.
- The unfreeze-sizehint calculation could be negative. Turn the initial
  size into constant and use that as a minimum, otherwise rehashing
  uses (more or less arbitrary) heuristics to come up with some number.
  Lots of fine-tuning ahead...
Clean up rpmdsNewDNEVR() a bit

- Eliminate numerous repeated direct accesses to ds N, EVR and Flags,
  instead grab them into local variables at entry. This also makes
  the function safe illegal iterator values (ie calling when iteration
  not started), previously the bounds were not checked.
Clean up rpmdsCompare() a bit

- Eliminate numerous repeated direct accesses to ds N, EVR and Flags,
  instead grab them into local variables through getter functions
  as they are needed. Besides making it easier on the eyes, makes the
  function safe(r) wrt illegal iterator values etc.
Use getter functions for name, evr and flags in rpmdsCurrent()
Split rpmds EVR comparison into function of its own

- The EVR comparison is a distinct operation of its own: rpmdsCompare()
  looks at the other properties, EVR comparison is done if needed.
  Doesn't affect speed or functionality, but cuts down on the
  big number of local variables and has the nice side-effect of
  making the xstrdup() allocations local within rpmdsCompareEVR()
Clean up rpmdsFind() a bit

- Eliminate numerous repeated direct accesses to [o]ds N, EVR and Flags,
  instead grab them into local variables through getter functions as
  needed: on entry for ods which doesn't change, for ds in the loop
  as we're changing ds->i here.
Add internal indexed variants of rpmds N, EVR and Flags getters

- We'll need these to eliminate the remaining direct accesses to
  N, EVR (and Flags) on random access patterns such as rpmdsSearch().
Clean up rpmdsSearch() a bit

- Eliminate numerous repeated direct accesses to [o]ds N, EVR and Flags,
  instead use getter functions and local variable for ods name which
  does not change.
Eliminate direct rpmds name (and flags) access on rpmdsNew()
Rename td2pool as rpmtdToPool, export and optimize

- Using rpmtd iteration for this is slow and stupid as we keep
  pointlessly re-re-re-re-re-validating the tag type and indexes.
- Change argument order to source -> destination
- Move to rpmtd.c where it belongs and make public with a decent
  name. Not sure if this is the kind of an API we really want to make
  public but ... at least for now it'll do.
Make rpmstrPoolUnfreeze() safe to call on unfrozen pool
Fix segfault on rpmstrPoolId() on frozen pool

- String -> id lookups need the hash table in place even if we're not
  adding. We could do a linear search in such a case but...
Switch dependency sets to use string pool storage for names and evrs

- Always push dependency names and versions into string pool (private
  for now). This is terribly wasteful for single ds items, even more
  so for rpmdsCurrent() but to keep the initial switch-over changes
  to minimum we'll deal with those later.
- While we freeze the pool for ds data from headers, single ds items
  are on purpose not frozen for now, due to interactions with
  rpmdsCurrent() and rpmds merging.
- Eliminate no longer needed rpmdsDupArgv(), we're now just copying
  a bunch of integers around. Sanitize rpmdsMerge() now that we can:
  realloc and shift the data instead of recreating all of N, EVR
  and Flags.
Eliminate assert()'s from rpmdsDup()

- The "can't happen" case where EVR/Flags are not present is just as
  easily handled as dying.
Eliminate assert()'s from rpmdsMerge()

- These "can't happen" cases where EVR/Flags in source ds are missing
  are just as easy to handle as is dying, handling is saner...
Unify the common parts of rpmds creation into a helper function

- No functional changes, just sanity-refactoring
Further split single ds creation into two, sigh

- Allow rpmdsCurrent() to share the pool and id's of its "parent" ds
  instead of having to repeatedly create and tear down entire pools
  just for a couple of strings. Used by python bindings for rpmds
  iteration so we'll want to be reasonably efficient.
- For now, rpmdsSingle() and rpmdsThis() always get a private pool,
  wasteful as it might be, but at least now we can freeze them.
Freeze the rpmlib dependency set pool on successful return

- ...to avoid wasting memory on the relatively static data. We could
  handle the rpmlib ds singleton behavior here too but it would change
  semantics. Ponder about it later...
- Would be nicer to have rpmdsMerge() freeze on return, but that
  gets called in loops so we'd be doing a whole lot of huffing and
  puffing recreating the pools on each entry.
Add an alternative rpmds constructor to allow shared pool usage

- rpmdsNewPool() allows specifying shared/private pool, and rpmdsNew()
  is now just a wrapper to always call it with NULL (ie private) pool.
Oops, only private pool should be frozen on ds create