Fix a sizeof error in RDebug.reg_sync(). By rewriting the whole function.
Fix gdb:// on linux-x86-{32,64}
fix 3 possible memleaks if io->redirect