Wip sd filestore optimization

Yes, this is right. The same code was under review for some time in other branches but it was not caught. The index object was not creating in those cases and the lock  was not happening. Now, because of the assert it is caught. I will change the code like the following.

  if (!replaying) {
    *outfd = fdcache.lookup(oid);
    if (*outfd) {
      if (!index) {
        return 0;
      } else {
        if (!((*index).index)) {
          r = get_index(cid, index);
          return r;
        }
      }
    }
  }