During the recent py3 conversion of the charm a couple of places
where the charm writes text in binary mode were missed. This
fixes that problem. Without this fix the charm errors with:
"TypeError: a bytes-like object is required, not 'str'"
Change-Id: I5c2af1dce12092c1ba1be4b4ad9a50261000e886