pack: use stack allocation for smaller delta chains

This avoid allocating the array on the heap for relatively small
chains. The expected performance increase is sadly not really
noticeable.
pack: don't forget to cache the base object

The base object is a good cache candidate, so we shouldn't forget to add
it to the cache.