Refactor delete buildpack command and make it idempotent
[#59245748]