Structural invariants of the singular Hamiltonian system and non-iterative solution of finite-horizon optimal control problems