[SQLite VFS] Track pending sync requests

The sync request are done asynchronously, in a dedicated thread,
which means that the database file can be closed meanwhile. The
database has no reference counting, thus it's required to track
whether there are any pending sync requests, to not free the
structure too early.