[commhistory-daemon] Trim surrounding whitespace from incoming messages

There isn't much point in keeping surrounding whitespace on messages, and it looks bad in display. It can also occur fairly often for IM messages from people using OTR's signalling feature.