Improve filesystem.try_remove to handle directories (when recursive=True)