Clear selection, context and rename for deleted files.

Fix for #9214.

cc @ingorichter 
You're right! It's only context and rename that need to be updated. I'll make an adjustment.