This is almost certainly a peripheral-related issue, especially if the 'pause 100' makes a difference. Something is writing to the port or turning outputs to inputs during the RMW operation.
As Henrik asked, which PIC?