Fix info and message path when storing a local message.

The uid is calculated when calling toRawData. So determine the path
afterwards.
Use QSharedPointer for data classes.

This fixes some delete problems and simplifies the code.