newdb: Replace dump and restore with vacuum

apsw has various issues with dump and restore, so replace it with
vacuum. Fixes #1217988 [Database integrity issue with V 1.0.0](https://bugs.launchpad.net/calibre/+bug/1217988)
Nicer error message when virtual library has no books

Fixes #1220030 [Content Server No Books Error](https://bugs.launchpad.net/calibre/+bug/1220030)
Expand ~ in content-server --with-library