Edit Book: Fix incorrect results when running replace all on marked text and more than one replacement is made. Fixes #1348941 [When applying the command Replace all with marked text, error happens](https://bugs.launchpad.net/calibre/+bug/1348941)