Follow-up to r1590982: Fix an out-of-bounds copy and factor out most
of the address / offset calculations to make the code easier to read.

* subversion/libsvn_subr/bit_array.c
  (svn_bit_array__set): When re-allocating the array, copy only data
                        *previously* allocated.  Use explicit variables
                        for the various stages of address calculation.
                        Use almost the code for bit set as for reset.
  (svn_bit_array__get): Use explicit variables for the various stages
                        of address calculation.

* subversion/tests/libsvn_subr/bit-array-test.c
  (test_sparse): New test checking for proper array growth and
                 (implicitly) for sparse allocation.
  (test_funcs): Register new test.

Found by: ivan


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1591872 13f79535-47bb-0310-9956-ffa450edef68