401 handling

These two changes ensure that an application using the Client can handle 401 responses correctly. I'll send a mail to the usergrid mailing list with more details.