Replace deprecated mktemp() by mkstemp()