Syncronize marshalling and unmarshalling, and some refactoring

When running on mutiple threads, using the Camel Seda route and
multiple consumers, concurrency issues appear to arise unless the
critical sections in LibCommProcessor are synchronized.