js: update headers after renewing token

This must fix issue #19 (Token renewal fails)