newdb: Handle databases with invalid ratings link tables

Fixes #1228517 [crashes on change library](https://bugs.launchpad.net/calibre/+bug/1228517)