Fix tests incompatible with latest WebSocket spec.

[Issue#]   265
[Problem]  Failing TCT tests.
[Cause]    The tests call WebSocket.close() and expect to get an
           onmessage event after the call and before the
           connection is closed. This can not happen according to
           the WebSocket spec.

           There are two important points:

           The first point is what WebSocket.close() is supposed
           to do:
           http://www.w3.org/TR/websockets/#dom-websocket-close

           3. -> Otherwise section applies in all tests:
           "Set the readyState attribute's value to CLOSING"

           The other point is what happens when readyState is
           not OPEN:

           http://www.w3.org/TR/websockets/#feedback-from-the-protocol

           "When a WebSocket message has been received ... follow
            these steps:

           1. If the readyState attribute's value is not OPEN, then
              abort these steps."

           Chromium aborts at step one, preventing any further
           onmessage events. The event handler would be called in
           step 5.

           All these tests call WebSocket.close() before the onmessage
           event is received, preventing the event to be delivered.

[Solution] Move the call to WebSocket.close() to the end of the
           onmessage event handler.

Change-Id: I068c008de8972c01a1d815c16ad16f9fe21a5ae0
fixture 1
Merge pull request #575 from tiwanek/XWALK-2208

Fix tests incompatible with latest WebSocket spec.