check_mailq: add sudo support

Just turning attached patch of github issue #1099 into a push request
(with some modifications)