(PUP-3635) Add scanf function

This adds a scanf function that is useful when converting from a string
to other data types.
Merge pull request #3287 from hlindberg/PUP-3635_add-scanf-function

(PUP-3635) Add scanf function