Various improvements. Close-on-exec and close on failure on either