common: Add function is_valid_mailbox_mem.
* common/mbox-util.c (mem_count_chr): New. (my_memstr): New. (has_invalid_email_chars): Change args to work on a buffer. (is_valid_mailbox_mem): New. (is_valid_mailbox): Rewrite to use is_valid_mailbox_mem.
- Signed-off-by: Werner Koch <wk@gnupg.org>