Merge pull request #1744 from billhollings/fix-prefilling-mem-leaks

Fix memory leaks when configured for prefilling Metal command buffers.