Don't make an task_id_str if there is only 1 left.
Only use the task_id_str if it isn't NULL
Make build_array_str extern so we can use it elsewhere.  Also make it
so when task_id_str is made we update the record in the database.
Get array_task_str and array_max_tasks to the database and out of it.
Fix invalid memory reference.