Refs #482: fixes test onerror.js

Error message for a ReferenceError is not equal
between Gecko and Webkit.
Fixes http headers in casper.open

Original http headers should be set only after the
query append, not immediately after calling webpage.openUrl.
The request initialization may take time, and so customHeaders
are not send because they are erased by the original value
before the request initialization. (at least in Gecko)