Solution of the SL(2,R) string in curved space-time