Make `--out` to create parent directories

Fix #1389.

I don't sure this should be treated as a new feature.
I consider this a bugfix, not a new feature.