Implemented dprintf. (Fixes #1250)

dprintf() is already declared in system/include/libc/stdio.h. This patch adds the JS implementation.