Fix bug where it wasn't propagating throwable in log api

https://github.com/couchbase/couchbase-lite-android/issues/398
Improve situation when server returns 504 error to _session

Before it was not saving the Error object in the replication

https://github.com/couchbase/couchbase-lite-android/issues/398