Update cognito_identity_credentials.js

Add try and catch block to account for instances when the localStorage exists but is not accessible. For example if the user has their browser set to block cookies and site data.