fix deleteDocument in RemoteStorage and add test for it