Fix segfault if task->metadata is NULL
also fix parse_time_string to allow for raw seconds to be passed in.
cmd_result tried to free a pointer returned by getenv in case when outputfile
is supplied by env variable.
filename and outputfilename vars are now freed in callback_outputfile prior to
another allocation.