Fix detection of GET_MATERIAL_FROM_REAGENT results in workflow.

Dereference pointer to strings. Also just return undefined
material instead of skipping the product if it still fails.
scripts/startdwarf
ruby: tweak item_isfree