Update pin_magic.h

fix race condition.
Using set/clear gpio registers...
This is safer in case other modules changes the gpio port data.