storage: fix index file rotation and removal