core: making block_registry thread-safe for multiple flowgraphs to access it.
runtime: 2 threading issues with the shared memory system.

1. Making a global mutex for the VM circular buffers to use and lock for multiple top_blocks to handle accessing the memory.

2. Catch the bad_alloc exception once and retry. After 1., this rarely happens unless the thread count gets large (> 20 as an estimate).