1.Fix an error in mkstemp() the could result in an infinite loop.
2.Fix for wrong output in some cases.
For Example:
1) input: "FILEXX"
output: "FILE00" and repeats same output for further invocations of mkstemp().
But, the ouput has to be FILE01, FILE02, ...., FILEZZ.
2)input: "FILEXXXXXX"
output: "FILE100000", for next invocation "FILE200000" and so on
But it's good, if the ouput goes like FILE000001, FILE000002, ..., FILE000101, ...
Signed-off-by: Lokesh B V <lokeshbv333@gmail.com>