Fixed a potential race condition between main and ISR when setting
a single port bit.