Mellin-Barnes representation for the genus-g finite temperature string theory