flopen improvements

* simplify flopen() code
* simplify flopen() usage
* make it unlock on __exit__()
* check that `lock` kwarg is True instead of that it exists