Actually write the message in folder::insert()

So this explains that corruption bug I was getting when I was
forgetting to purge a message from the server -- I just forgot to
fclose()!

I went ahead and added a fflush();fsync(); in there as well just to be
extra safe.  This way I'll have the file flushed to the disk before I
commit the SQL transaction, which is correct.  I'm pretty sure I
should also be doing a fsync on the containing directory, but I'm lazy
(and at least that should result in a missing message, not a truncated
one).