Add ScopedFd.release() and TEMP_FAILURE_RETRY the close().

Also, check for fd being -1 in destructor. There's no need
to set errno to EBADF after release() or if an open() call
used to initialize a ScopedFd failed.

Change-Id: I97c6c7db797a20c6850a36c61fe5b369547c4002