C++ Compatibility

I have updated linenoise.c so it can be included directly in C++ projects (simpler compilation). No major changes, just some casts here and there.