fix #394. this cleans up some handles after using them, and doesn't disable ALL process privileges upon success
Merge pull request #397 from vtjnash/develop

fix #394