test/librbd/fsx.c: fix potential unterminated string handling

In case of strncpy() make sure string is '\0' terminated. Before
usage of strcat() check if the destination has enough free space
to concat the char and to terminate the string to prevent illegal
memory access.

Fix for:

CID 1219459 (2 of 2): Buffer not null terminated (BUFFER_SIZE_WARNING)
 buffer_size_warning: Calling strncpy with a maximum size argument of
 1024 bytes on destination array goodfile of size 1024 bytes might
 leave the destination string unterminated.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>