Update whoosh index script to try and commit the work so far when an unexpected exception occurs.