Bugfix: fixed a bug in using pwm with c/c++ caused by the port from fopen to POSIX open

Signed-off-by: Maximilian von Tschirschnitz <maximilian.tschirschnitz@gmx.de>