fix some errors for distributed lm_finetuning
1. makedirs 
2. save models
# [Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797?src=pr&el=h1) Report
> Merging [#797](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/pytorch-transformers/commit/5fe0b378d899f81eb0a7f2db0c4eb0234748e915?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797/graphs/tree.svg?width=650&token=9qOlN6Hb1c&height=150&src=pr)](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #797   +/-   ##
=======================================
  Coverage   78.91%   78.91%           
=======================================
  Files          34       34           
  Lines        6193     6193           
=======================================
  Hits         4887     4887           
  Misses       1306     1306
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797?src=pr&el=footer). Last update [5fe0b37...a7ba27b](https://codecov.io/gh/huggingface/pytorch-transformers/pull/797?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
<|||||>Hi, do you want to update these examples to the new `pytorch-transformers` API at the same time?
Models now return `tuple` so we should take the first element of the model output as the loss and we should also update `BertAdam` to `AdamW`.<|||||>ok， I  have a try, I‘m stilll use the old API. <|||||>Hi,  I have updated the opt to the new API , please check. <|||||>Thanks @yzy5630!