[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

Cherry-Pick: e74d798796974081081eafb00da15ce526c3ce2e

BUG=https://crosswalk-project.org/jira/browse/XWALK-1721