fixes #2206: race condition prevented generated ebooks from saving