Properly handle fields too short in io_lib_format

Values for which the precision or field width were too small in io_lib_format could trigger an infinite loop or crash in term/5.

@richcarl