Add support for firing 'deviceready' events registered before cordova-js is loaded.

... is loaded.

Tested on iOS.