We need to remove the file only if its length is zero. That means we only delete the cidFile if we haven't written a container ID to it.
This is easier because we don't need to add specific cleanup based on where we're erroring out from.