Copy-paste process leak fix from Riak-CS

https://github.com/basho/riak_cs/pull/321

Had to do some name changes and etc.
to make this work in stanchion. Yuck.
Merge branch 'hotfix/1.3.1.1'