Fix KeyboardInterrupt in map and bad indices in select
Thanks @TevenLeScao for finding this issue Thanks @lhoestq for catching this ❤️
If you interrupted a map function while it was writing, the cached file was not discarded.
Therefore the next time you called map, it was loading an incomplete arrow file.

We had the same issue with select if there was a bad indice at one point.

To fix that I used temporary files that are renamed once everything is finished.