[CHEF-2682] Redirected API requests can result in confusing error messages

http://tickets.opscode.com/browse/CHEF-2682

Added InvalidRedirect exception, raising it and handling it where needed. This pull request replaces the previous one : https://github.com/opscode/chef/pull/534

I'm very new to contributing to open-source projects, please let me know if I did anything wrong :)