Use mkstemps(3) instead of mkstemp(3) when appropriate.
More sbuf(9) use.