Allow escaping of ~ in EDITOR
Close the temp file before deleting it

Ruby marks files as open on Windows and attempting to delete one without
closing it first will result in a crash.