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