Scotland have kept their hopes of remaining in the top flight of the Nations League with a 1-0 win over Croatia at Hampden.