Fixed a possible race condition btween main and ISR when setting
an individual port pin.