Allow creating attachments on unsaved documents.

Saving the attachments reference inside the document body would still fail
because cannot predict the doc_id.
Turns out that multipart document saves works only for updates not
for creating new documents. Adjust the api calls accordingly.