getopthelp: Check for option consistency

More specifically, check for duplicate long option name, short option
name, or option id.

Signed-off-by: Celelibi <celelibi@gmail.com>