retention data: Fix retention data being overridden by config change

Putting the variables that track states for objects inside the
loop where things were changed meant we either never got a value
there, or always got one (depending on CFLAGS).

Hoisting it out of the loop means we can retain state properly
per object and the retention data stuff now seems to work as
intended.

New in this patch is that we ignore the modified_attributes var
if we end up having listed config:<something> entries and also
have stashed the <something> entry as well, since that's how we
mark changed entries since the first (failed) attempt to get this
right in 7ecb99f15691cdd777f93d0572a2180696bed925.

This should fix op5#5358.

Signed-off-by: Andreas Ericsson <ae@op5.se>
tests: Add retention data tests to test_config.c

The recently fixed retention data functionality needs some tests.
This provides the verification parts of op5#5358.

Signed-off-by: Andreas Ericsson <ae@op5.se>
t-tap/.gitignore: Add test_config to .gitignore

It's a build product, so get rid of it.

Signed-off-by: Andreas Ericsson <ae@op5.se>