hcore: Added "close on exec" flag to sockets and files.