MOBI Input: Fix regression parsing &apos;

MOBI Input: Fix a regression that broke parsing of MOBI files with
malformed markup that also used entities for apostrophes. Fixes #1197585 [Private bug](https://bugs.launchpad.net/calibre/+bug/1197585)
Refactor creation of hardlinks on windows

After creating the hardlink, open and close the file, to ensure that
the directory entry for the file contains the correct file size, see
http://blogs.msdn.com/b/oldnewthing/archive/2011/12/26/10251026.aspx