Refactoring of filecache_open and get_fresh_fd. Should support grace.