Keeping postgres connection behind load balancer alive during long-running query (vacuum)
There is no way to have activity on a database connection that is waiting for a server response.
I'd say that that is a bug in the load balancing software, and you should report it. Your use case is a valid one.