Javascript cleanup.

- Declare delayDefault as a local variable.
- Handle missing transport in send() and close().
  The transport might be missing if we are in the
  middle of a reconnect attempt.
- Drop transport reference after closing.
- Use null instead of false for missing transport.