23239bc py3: create_cert_db: write to file in a compatible way

Authored and Committed by mbasti 2 years ago
    py3: create_cert_db: write to file in a compatible way
    
    Py3 expect bytes to be writed using os.write. Instead of that using
    io module is more pythonic.
    
    https://fedorahosted.org/freeipa/ticket/4985
    
    Reviewed-By: Christian Heimes <cheimes@redhat.com>
    Reviewed-By: Jan Cholasta <jcholast@redhat.com>