newdb: Allow sorting on ids

Fix regression that broke calibredb catalog when sorting on the id
field. Fixes #1216090 [calibredb catalog fails on sort_key - KeyError: 'id'](https://bugs.launchpad.net/calibre/+bug/1216090)