Fixes for Gmail login

Taken from https://github.com/mozilla/persona-ios
and https://github.com/mozilla/persona-ios/pull/2
Fixes couchbase/couchbase-lite-ios#87