[WebSocket] Do not send close frame while there is a pending message.

When WebSocket.close is called, the close frame should be sent after sending
all pending messages.

http://www.ietf.org/mail-archive/web/hybi/current/msg10483.html

BUG=386060

Review URL: https://codereview.chromium.org/349543004

git-svn-id: svn://svn.chromium.org/blink/trunk@176609 bbb929c8-8fbe-4397-9dbb-9b2b20218538