[libcommhistory] Implement message parts with SQLite

This targets next for now.

Implements storage of message parts which are files with a content type, id, etc, associated with events. The database stores metadata only, and doesn't handle the files themselves.

To avoid a mess of fragile database conditions, the actual files will be cleaned up asynchronously for parts with no associated event. That code will come separately and partly in commhistory-daemon.

The message part API is also significantly changed.