Clarify memory management for selection values

Add asserts for cases where memory would be leaked when assigning the
storage pointer for gmx_ana_selvalue_t.  Add functions for cases where
the assignment is combined with some other operation that takes care of
the memory deallocation or ownership transfer to make the asserts not
give false positives.

The above clarifies the memory management and makes it less prone to
errors, but does not fix the memory leak that was revealed by "z of ..."
implementation.  To actually fix that, additionally split the logic for
freeing memory for gmx_ana_selparam_t, and call that also from the place
that earlier set the value pointer to NULL.

Move Doxygen documentation for some of the affected methods and their
neighbors to the header per newer guideline.

Add some extra debug output.

Change-Id: I4e5dfa1248a20cab8a242be7209b5b0779204e64