Reuse sessions inside of message processors.

We can't create a session inside of a message processor, so without
this, publishing from one isn't possible.

This uses a threadlocal for the current session, which may not be the
best idea. I suspect this will change when we implement XA.
Add copyrights.