Fix crashes when switching libraries with marked books

Fix a bug that could cause calibre to crash when switching from a large
library to a smaller library with marked books. Fixes #1239210 [Calibre 1.6 64bits crashes when changing library](https://bugs.launchpad.net/calibre/+bug/1239210)
Update Diagonales

Fixes #1239235 [Updated recipe for Diagonales](https://bugs.launchpad.net/calibre/+bug/1239235)
Start work on global undo/redo for tweaking