Fixing problem with lock on files
Created by: stavamichal
- lock on files in perl not work properly, so we need to fill files after threads work to prevent overlaps on records
- also add binmode:utf8 for gen script to prevent problems with wide characters in email domains