Refining the fix made in #5885.

It turns out that some of the assumptions in #5885 were slightly off. The previous fix relied on a call to the module to create a tmp_path. This is insufficient as there are few cases that we need to have the tmp directory before we make the module call. If we don't have a tmp_path before we do a recursive call or when we find a file that does not match the remote md5 hash we need to create a tmp directory. Also we are not more precise when we will need to clean up the remote tmp_path.

'make clean tests' and extensive playbook testing has been made to cover the problems here.

Output from 'make clean tests':
Ran 96 tests in 15.935s

OK (SKIP=1)