fix -T works and add unittest for 401 with -T

Currently, local variable 'token_key' could be
referenced before assignment, when using -T option
and swift returning 401 Unauthorized.

This patch fixes above and adds unittest for
401 handling with -T option in ignoring_http_responses.