D1 string dynamics in curved backgrounds with fluxes