Only call onopen after we have ensured that the connection has actually been opened.

Firefox likes to do readystatechange events (0->2) when reconnecting fails but these
attempts have status==0 (as opposed to 200) and should not trigger onopen.

Related to #15, fixes http://dev.vaadin.com/ticket/12492
Merge pull request #54 from Artur-/master

Only call onopen after the connection has actually been opened