fs: move makeCallback and maybeCallback to util

`makeCallback()`, `maybeCallback()`, and `rethrow()` declared in fs
can also be used in other places.