Fix attribute access for SQLAlchemy tuple types

Fixes serialization for SQLAlchemy's KeyedTuple, and other types that look like dicts but don't respond to obj["key"].