Main Window:lock file based on fcntl