pass error from sync task to client

Added passing of error from sync task to client. @jh-bate ready for review, with https://github.com/tidepool-org/in-d-gestion/pull/36
@jh-bate Hmmm. We are not using http error codes. I'll update.