mfiutil: Change mfi_autolearn_(period|mode) to write to a FILE

This avoids using fragile logic with snprintf() to build strings.

For the calling code in mfi_show.c, I chose to pass stdout directly
instead of using fmemopen() to write to the temporary buffer since
that is simpler and avoids having to deal with output truncation.

Differential Revision:	https://reviews.freebsd.org/D50881

Import from FreeBSD base commit fe1cd73, with changes
3 files changed