Merge pull request #188 from ncharles/bug_4178/int/correct_cfengine_to_remove_directory_on_copy

Fixes #4173: integrating patch of cfengine 3429 to allow the agent to purge folder on copy
Fixes #4158: integrating cfengine 3140, to prevent the promises fro being check at every run