Added prev_state for directory
Merge pull request #5264 from drewlll2ll/file-fix

file module: Fixed missing prev_state == 'directory' in file