After reading this thread and the related one, I concluded that the problem
was to do with samba, which I don't use. I uninstalled everything to do with
samba despite warnings that this would uninstall Trisquel7, and that fixed my
problem with keyboard lag. Everything is nice and responsive now. I don't
expect to see that sudo parameter memory leak problem again, but if I do I'll
mention it.
I'm surprised that the bug has existed for about 6 months, but I don't know
how such things are dealt with or if anyone is responsible, but I'll try to
get into the habit of reading Ubuntu forums in future.
I'm now looking forward to the final realease of Trisquel 7. This is the
distro for me!