Corrected build output encoding problems.

Depend on charlock_holmes gem for encoding detection.
New Build#read_tmp_file method to correctly read the tmp file. This can
contain anything from the build process, so we cannot rely on
default_external encoding when we read in this file. We must read the
file, detect its encoding and convert it to utf-8 replacing invalid
sequences.
Build#compose_output was changed to call this new method.