Hold cs_main in SendMessages() for shorter period of time.

Much runtime under cs_main seemed unneeded here.

cs_main is a highly contended lock that is held for a long time.

Let's not merge without careful review & testing...

Making a copy of state sounds dangerous, as there is global state that contains iterators to entries in it.