Only cleanup thread array lists if they have been allocated.
Merge pull request #16 from brendandahl/shutdown-test

Only cleanup thread array lists if they have been allocated.