Interplay between lithospheric flexure and river transport in foreland basins