[fix] Clean up saneopt__pad_right; use saneopt__allocate

- New saneopt__allocate rather than repeating malloc/realloc everywhere
[fix] Fix errors reported by valgrind