E0d/handle 301s

@jarv @davestgermain This PR refactors status_code handling to be more defensive and explicitly lumps 301 with 302 for xqueue because of https://openedx.atlassian.net/browse/LMS-11150
Can you change the login url to have the trailing / if it's required?