Make sure script.parentNode exists before removing the script element

When creating a lot of JSONP requests, I observed that sometimes parentNode is undefined and it causes some uncaught exceptions.