better handling of closing script tags

Scripts can contain tag characters within their bounds (string,
templates, etc). These characters should not cause the script tag to
appear closed. Wait for an actual script tag closure.

Note that the presence of the full string "</script>" within the tag
will still cause termination as no checking for quotes or other
specifics is done. This just expands the termination check slightly.