Dvolgyes fixes

Hi,

Please, review these fixes I made. They are basically string and memory handling related changes:
- some str*cpy change: size parameter, NUL termination, etc.
- snprintf: the size of the memory region contains the last \0, so there is no need for .... ,SIZE-1, like constants
- sometimes strncpy is just a slow implementation of memcpy
  (e.g. len=strlen(source); strncpy(target,source,len);  
   In this case strncpy will NOT copy the last \0, therefore memcpy is fine. (Or strcpy without strlen, it depends on the situation.))
 - some other small fixes.

Environment: I tested the code with tokyocabinet, using Ubuntu 12.04 (x64), gcc 4.6.3


I'm amazed the previous form compiled !  However, your change assigns a string literal (of type `const char*`) to a (non-const) `char *` variable, which shall get warnings.  Better to use the string as initializer for an array:
```
char helper[] = "/redirection_test_stub";
```