https-proxy-agent: don't use `socket.ondata`, use the official API instead...

Fixes problems with upgrading an existing TLS socket to another layer of TLS
(i.e. the HTTPS endpoint over HTTPS proxy scenario).
test: add tests