[backend] lock log file before writing

this prevent race condition when two workers appends data at exactly same time.
1054082 - general: encode to utf8 if err in mimetext

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1054082
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
[backend] - add missing import

addressing:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/share/copr/backend/dispatcher.py", line 390, in run
    callback=mockremote.CliLogCallBack(quiet=True,logfn=chrootlogfile))
  File "/usr/share/copr/backend/mockremote.py", line 456, in __init__
    self.callback.log("Setting up builder: %s" % builder)
  File "/usr/share/copr/backend/mockremote.py", line 211, in log
    log(self.logfn, msg, self.quiet)
  File "/usr/share/copr/backend/mockremote.py", line 89, in log
    fcntl.flock(lfh, fcntl.LOCK_EX)
NameError: global name 'fcntl' is not define
[spec] tighten acl on copr-be.conf