on plugin finished: unlock first, then del pidfile