msgserve fixes

did you try, ```
with locks[LOCK]:
```
?

Here, you fail to release the lock in the exception, you would require a ``finally:`` clause, but the ``with`` context manager takes care of all that, so I would prefer it as a pattern