cgi-handler: add file lock to prevent recursive calls