Malaysia and Indonesia say they will no longer turn away migrants, a breakthrough in the region's crisis.