Avoid resource leaks in case of exception

Change-Id: I4461ab619a71fcbe18d4d805a964fd358e857eda
Drop unnecessary #include

Change-Id: I2a879712adfad3307d608eca0b27f674d32e6a73