Implement the proposal at
seems to work for me, at least the subroutines get run, and you can
e.g. "sleep 10" in the cleanup handler without holding up the request.
One potential caveat here is that by passing the $env hash to the
post_client_connection_hook routine we might be causing something
evil, but I haven't spotted any problems with it so far.
Note that we have to re-check the harakiri flag in
post_client_connection_hook because the cleanup handlers might set it.