My best guess would be a grounding issue. Evidently you are powering the PIC independent from the PC. When the PicKit is connected it changes the potential on the zero rail (ground).