* Protect pidlist with a mutex to avoid a race causing a duplicate
free() when the same pipe FILE is pclosed()'d in different threads,
and to avoid corrupting the linked list when adding or removing
items.