[web] implement function to clear database content
Summary:
Sometimes we might want to manually delete file and destruct object in runtime. Otherwise, Emscripten will use reference counting to destruct objects.
Depends on D8553
Test Plan: Tests in D8558.
Reviewers: michal, tomek
Reviewed By: michal
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D8611