cleanup code for document.currentScript workaround

Picking up comments on https://github.com/kossebau/WebODF/commit/18fe94c7b266b73613933c197d3bbe6aef08079d