What is the reason for doing this outside of ```CheckFileChanges()``` ? Right here, there might be many threads accessing lastseen db. But if you do it in there, there can be only one.

I'd suggest to do this check at the only place that can change CFD_MAXPROCESSES: server_transform.c line 344. There it is guaranteed that the server is single-threaded.