rw.db: cleanup and allow multiple connections