file_system: group promisify, avoid relying on in-advance fs.exists checks (#112)
file_system: group promisify, avoid relying on in-advance fs.exists checks (#112)

* file_system: move promisify to top

No need to call promisify() per every method call,
we can do that once instead and save the result.

* file_system: avoid relying on in-advance fs.exists check in dir creation

This avoids possible race conditions, e.g. when more than one
parallel async .save() operation is called (from a single or several
processes) sharing a common prefix which does not yet exist.

Instead, createOrVerifyDirectory() now just tries creating the dir,
and if that fails -- checks _why_ that failed, if it is anything
other than the directory already existing -- throws an error, if
it's the dir already existing -- skips that and continues.

Refs: https://nodejs.org/api/fs.html#fs_fs_exists_path_callback

* file_system: remove remaining fs.exists calls

Instead, use fs.stat and fs.readFile directly and let them throw if
the file in question does not exist, and format the error in a way
how we want using a small helper function.

tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs-node,tensorflow/tfjs-node,tensorflow/tfjs-node,tensorflow/tfjs-node,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs-node,tensorflow/tfjs,tensorflow/tfjs