South Korea's won hammered as funds buy foreign stocks