maintain a cache of opened files

While testing some not so subtle program, I ended up receiving Sys_error("Cannot allocate memory").
The reason was that the maximal virtual memory limit was exceeded, because some files where read _a lot_. This patch fixed my problem.

Not that this is some kind of proof of concept and based on 1.2.0 (i'm using irmin 0.8.3 which enforce this version). If you consider adding this I can redo a clean patch.