Terminal: Fixed resource leak CID:702031

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>