Removing dependency on SCOPED_EXIT as gcc 4.4 does not like it