Clean permissions cache when deleting file

for #1602

@MTGap @karlitschek