swf module: add backward-compatible support for Python 3.3+

The last two integration tests already failed for unmodified version, sorry but I didn't figure out why.

My port passed the unit tests, and get the same two errors across all python versions.