Fix memleak in r_lib_new
Fix memory leak in r_io_plugin_init
Fix memory leak in r_debug_trace_new
Fix memory leaks in r_io_new
Fix memory leak in r_graph_new
Fix memory leak in r_sys_getdir.

Note: calling getcwd with dir=NULL is a Linux-specific extension of POSIX,
not sure if works on other non-windows platforms.