better support for legacy browser onload

Some old firefox doesn't detect onload using 'in' properly and this
tries to use readystate stuff which doesn't work.

Instead we force set onload if it isn't set. Browsers that support
onload will have it set and browsers who don't will ignore it.