Deallocating both onload and onerror handlers.