Resolve common realloc mistake in lib/rsa.c

By replacing the realloc calls with g_realloc calls we avoid losing previously
allocated memory that would be overwritten with the NULL failure return value of
realloc.