This is a reply I just got from Heroku:
"Unfortunately, our load balancers automatically keep a pool of TCP
connections open to their backends (in this case, the Heroku routing
layer). When a client connection closes, the load balancer doesn't
close the connection to its backend, and therefore, neither our
routing layer nor the web process running on the dyno are aware of
this event.
We're not pleased with this solution but unfortunately we've yet to
come up with a work-around."
Sound like I'm out of luck. Any alternatives?
Thanks,
Yuriy.