Implementation of gets_s for C compilers that don't yet support it.