Lockfile cleanup.

Remove locks when 404 and before redirect.