Fix for issue: https://github.com/aws/aws-sdk-ios/issues/52

Implements the fix suggested in the issue which works to fix the crash