Rework responses to datastore API calls

We are now responding the main call immediately. If we fail
to write to update the datastore, we just return an error to
the stream close call.

This will allow to simplify the javascript API. The double
datastore call on create is unfortunate but I prefer to keep
the API clean of sugar specific limitations, we can fix the
implementation later if necessary.
Add datastore.set_metadata