pkg/cli/apptest: Guard access to buffers in fakeTTY with mutexes.
pkg/cli/apptest: Guard access to buffers in fakeTTY with mutexes.

This addresses race conditions found when running "go test -race pkg/edit".

This addresses #73.

elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish