use the free_value_callback also when using the tagged-based api

old (default) behaviour is unchanged