This function sets the queue name for the task. If the task already has an open queue, then that queue is closed. If qname is non-NULL and the task had a previously open queue, then the new queue name is opened and initialized with the same permissions.