Update htmlfile.py

Catch unloaded (eg refreshed) parent causing errors in child iframes ("Can't execute code from a freed script" in IE8)