Documentation: use non-binary write mode for generating `templatebuiltins.js`

This would cause an exception in Python 3 when trying to `make html` the docs.