only flash 401 errors in prod if they are unauthenticated

fixes CNVS-15975

test plan:
- hit a page with an ajax action that is unauthorized: (for example, right now
  there is a bug that causes this if you set the course homepage to be the
  assignment index page and then visit it as a user who has a student enrollment
  in a different class)
- it should show a 'development only' flash error in a development environment,
  and not show any flash error in a production environment
- also retest commit e45ff7189aee3edefb62de8f087bb6b871b2d1a9:
  * in one tab, start to fill out an ajax form
    (e.g. editing a quiz)
  * in another tab, log out of canvas
  * return to the original tab and try to
    submit the form (e.g. save your changes)
  * should get an error message with a link to
    login in a new tab
  * login in the new tab
  * return to the original, and try to resubmit
  * should save successfully

Change-Id: I2fc4c1d46b3ba510336957e4e93875d58677583e
Reviewed-on: https://gerrit.instructure.com/43189
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>