Preparation of hydrocarbons from hydrocarbons containing the same number of carbon atoms by dehydrogenation with a hydrogen acceptor with sulfur or a sulfur-containing compound as an acceptor