Fix two bugs in dotnoise.

dotnoiseEdit was returning prematurely, while dotnoiseBeep was
writing the wrong character.
Add test for dotnoise.

Test is a simplified version of example.c from antirez/linenoise.
Add tool support for debugging.

Add the -g switch to CFLAGS and ignore the generated directories.