Fix thread safety issues

The use of lock to protect List<T> seems inconsistent in two parts of the FastCGI server.  I was able to reproduce failed enumerations due to unsynchronized access to the lists using Apache Bench.