Consider electric-pair-mode in tex-mode.

Fixes: debbugs:19356

* lisp/textmodes/tex-mode.el (tex-insert-quote): Consider and respect
`electric-pair-mode'.

* test/automated/electric-tests.el (autowrapping-7): New test for
tex-mode's autowrapping.
(electric-pair-test-for): Call the actual key-binding
interactively.