issue #305. prevent resultset loss by placing flock on separate lock file.