Main window: Lock file based on fcntl module.