Use user-provided buffer

In the previous versions we silently allocated quite a large, fixed size
buffer to store watchdogs.
This commit changes the interface to get a user-allocated buffer,
allowing for various sizes, which results in decreased memory use.
Update README example