Create pki_dir if it does not exist

Resolves issue #215.