Fix kill_stale_intents to handle directories.