Handle tempfile content encoding

When a tempfile tuple is given to create allow that tuple
to optionally provide the encoding to use when the content
string is written (default it to utf-8 if not provided).

This is to resolve the need to worry about encodings when
oslotest is used in py3.x where the tempfiles that are currently
opened are opened in binary mode (and therefore aren't able
to write unicode strings without encoding).

Change-Id: Ibd42d14977b3438aada162199d82661c58fa5f73