Fix _safe_cast of ASFUnicodeAttribute

Fixes #578
Merge pull request #579 from johtso/fix-safe-case-asfunicodeattribute

Fix _safe_cast of ASFUnicodeAttribute