Socket#onClose(): ensure transport won't stay open.

There are rare error cases when transport could stay open in the background
even if socket is closed, so it is better to always call
`this.transport.close()` in Socket#onClose as it is idempotent and
safe to call multiple times.
Make Request#cleanup() safe to call multiple times.
Cast hasAttachEvent to boolean early
fix the this object for onlyBinaryUpgrades
Merge pull request #275 from plievone/ensure-transport-close

Ensure transport will be really closed in all cases
Merge pull request #277 from nkzawa/patch-1

Fix the this object for onlyBinaryUpgrades
Automatically rewritten for npm.