Fix implementation for putchar

According to manual: putchar() return the character written as an
unsigned char cast to an int or EOF on error.

Use return value of write to return the correct value for putchar.
Merge pull request #23 from MartinNowack/fix_putchar

Fix implementation for putchar