Use glib allocation functions in lib/utils.c

Since other function in lib/utils.c are using glib functions for memory
allocations and return their pointers (which then have to be freed accordingly
with g_free), we do the same for strsplit_by_space and strsplit_by_char. In
addition g_realloc is used instead of realloc since no proper error handling is
done if the realloc call fails. Therefore previously allocated memory would be
leaked. Since almost any other function uses glib memory allocation functions
will make the application terminate upon an memory error, we can assume to use
glib functions here as well.