Fix race condition in secure_cartridge

Remove Dir.chdir and use absolute file paths instead because chdir is
not thread-safe.

Bug 998345
Bug 1025043
Merge pull request #4091 from ncdc/fix-secure-cartridge-race-condition

Merged by openshift-bot