Heartbeat: don't connect when a response is not expected by any script (nothing to send), remove debug logging, clean up code formatting, see #23216

git-svn-id: http://core.svn.wordpress.org/trunk@24268 1a063a9b-81f0-0310-95a4-ce76da25c4cd