Suddenly started crashing - mono-sgen pthread_mutex_lock.c

I think I am having a closely related problem. My counting files never gets past a couple of thousand, then it hangs with connecting to server error. It aborts, and recycles the process in an endless loop.

Reading your thread prompted me to check journalctl. I found this line at the beginning of each loop iteration:
mono-sgen: pthread_mutex_lock

I also just came across this in the log, not sure if it is meaningful or not:
abrt-server[21904]: Blacklisted package ‘mono-core’