Move mbox operations that were done in mx_commit_message to a dedicated mbox_commit_message function.