Variational formulation of compressible hydrodynamics in curved spacetime and symmetry of stress tensor