DB: Delete corrupt database. #2547

* Also use readonly DB access for SocketAPI.