index: fix index merging on windows

On Windows:
- Opened files cannot be moved
- Move will fail if destination exists

This revision adds error checking when the new index is replacing the
former one, and makes merge() release its opened files/mmappings. Note
that unmapFile() implementation was left blank for non-windows platform
as it is not strictly necessary and I do not have systems to test the
change.

The following sequence will now correctly work on Windows:

  $ cindex a
  $ cindex b

instead of silently failing to update the index with b content.