[platform] remove NULL use when not needed
[platform] split gpio and serial header files to 'platform' header file and 'other' header file. This avoids type collisions and allows platform layer to remain independent of upper layers