While locks of files can be removed and the file handle held open between writes, this should not be done unless you also remember to resynchronise the file handle when you subsequently reacquire a lock on the file handle. Eg.
Failure to resynchronise the file handle can cause many problems where multiple processes are accessing and updating the file handle simultaneously - This aspect of file locking was discussed in detail in this thread.