Relativistic Closed-Form Hamiltonian for Many-Body Gravitating Systems in the Post-Minkowskian Approximation