net/protocol.rb: fix SMTP dot stuffing

* fix SMTP dot-stuffing for messages not ending with a new-line

When a message body ends with just a "." and no new-line Ruby does not dot-stuff correctly.  The remaining butter (after the last new-line) also needs to be dot-stuffed properly to avoid SMTP errors.

This includes a patch as well as passing test.

Reference:
* https://bugs.ruby-lang.org/issues/9627
* https://github.com/mikel/mail/pull/683