[Android] Fix Python 3 compatibility issue in packaging tools.

* Fix the open file mode which will cause str type error in Python 3
* Use sys.maxsize instead of sys.maxint since sys.maxint is remove in Python 3

BUG=https://crosswalk-project.org/jira/browse/XWALK-1721
Merge pull request #1966 from sqliu/fix-python3

[Android] Fix Python 3 compatibility issue in packaging tools.