On a 401 response, we do retry 1 more time, but first we go and get a new token to try with.  This code above will not work as it will not add the new token to the headers.  This would need to be changed to remove the existing header if it exists.  However, we have not seen the said exception before in our testing, can you please send an example of when you are getting the error?