gpgscm: Fix copying values.
* tests/gpgscm/scheme.c (copy_value): New function. (mk_tagged_value): Use new function. (opexe_4): Likewise for OP_SAVE_FORCED.
Occasionally, we need to copy a value from one location in the storage
to another. Scheme objects are fine. Some primitive objects,
however, require finalization, usually to free resources.
For these values, we either make a copy or acquire a reference.
Fixes e.g. a double free if a delayed expression evaluating to a
string is forced.
- Signed-off-by: Justus Winter <firstname.lastname@example.org>