Troubleshooting an issue with a deferred script being processed by W3TC as a sync script and discovered that the regex here is not matching scripts that have defer="defer" or async="async".
The longer attribute variation is used when $html5_script_support is true in wp_sanitize_script_attributes() (the meaning of which is actually backwards)
Possible fix: change the regex from:
'~\s+(async|defer)[> ]~is'
to
'~\s+(async|defer)[>= ]~is'
i.e. async or defer followed by a space, equals or greater than.