Use tough-cookie CookieJar sync API
Emit error, not cookieError
Merge pull request #767 from stash/stash/sync-cookie-api

Use tough-cookie CookieJar sync API