Merged r39133 from trunk

This patch by usa prevents tests on windows from failing due to missing
chmod support.