cmd/go/internal/lockedfile: add package and support library
lockedfile.File passes through to os.File, with Open, Create, and OpenFile
functions that mimic the corresponding os functions but acquire locks
automatically, releasing them when the file is closed.
lockedfile.Sentinel is a simplified wrapper around lockedfile.OpenFile for the
common use-case of files that signal the status of idempotent tasks.
lockedfile.Mutex is a Mutex-like synchronization primitive implemented in terms
of file locks.
lockedfile.Read is like ioutil.Read, but obtains a read-lock.
lockedfile.Write is like ioutil.Write, but obtains a write-lock and can be used
for read-only files with idempotent contents.