Hanging fix

Puts a timeout on the refresh token query.

Don't merge yet please.