refactor wide-char scanf string handling

this brings the wide version of the code into alignment with the
byte-based version, in preparation for adding support for the m
(malloc) modifier.
implement the 'm' (malloc) modifier for scanf

this commit only covers the byte-based scanf-family functions. the
wide functions still lack support for the 'm' modifier.
implement 'm' modifier for wide scanf variants