Check perms for file.directory test=True, Fix #5573
Set the result properly if test=True
Use empty dict, not None, for safety
Only set `result=None` if there are changes waiting
Merge pull request #5596 from basepi/directorytest5573

Check perms for file.directory test=True, Fix #5573