[api] Make `saneopt_arguments` return a NULL-terminated array
[api] Handle `realloc` errors
[api] Implement `saneopt_get_all`