Revise previous revision.

In f2b4954 we have changed the code to reset err.  This would defeat
the later code that handles errors.  Looking into the construct again,
it's more reasonable to use a temporary variable instead, like the
one used for DS_FIELD_BOOKMARK_NAMES.

Ticket: #6848