Foreign portfolio investors take a U-turn by unwinding long positions