Add getopt and getopt_long (libc) support

Test code is taken from functions' man pages.

Signed-off-by: manuels <manuel.schoelling@gmx.de>
Own getopt is not required for openjpeg anymore

Signed-off-by: manuels <manuel.schoelling@gmx.de>
Fix to undefine __dead macro after definition in err.h

Signed-off-by: manuels <manuel.schoelling@gmx.de>