Fix potential crash in case of abort while update:

We need to reset ctx->remote.read_from_db  BEFORE caling vio_closedir
Otherwise, it may interpret the handle as a 'bdtree' handle instead of
a owncloud handle.

Should fix #1442