Thanks, @suma, @kmaehashi 

I thought the lock is released when ``ofs.close`` or destructor of ofstream is called.
But it wrote the code of  unlock. Sorry..

I tested in follows code:
```
   :
  throw std::exception();
  flock(fd, LOCK_UN);  // unlock
   :
```
In my test, lock was released.

As @kmaehashi say, I think unlock is not required.