Check if previous window.onerror exists and is a function