Fix _safe_cast of ASFUnicodeAttribute

Fixes #578