flopen improvements

* simplify `flopen()` code;
* simplify `flopen()` usage;
* make it unlock on `__exit__()`;
* make `lock` argument of `fopen()` actually work;
* check that `lock` kwarg is True instead of that it exists;
* reduce size of critical section under `flopen()` in fileserver.