Automatically refresh the OAuth token if necessary.