Fix a profiling crash on Windows.
fprint_ccs used snprintf() to avoid overflowing a buffer; on mingw32
where snprintf() doesn't exist we were just using the straight
sprintf(), which inevitably lead to a crash. Rewritten to use a
homegrown non-overflowing string copying function - it actually looks
nicer now, anwyay.