handle 401 exception correctly if thrown in controller

this change is needed because of a change in zf
fixes test