packages/pkgbuild: internal Git operations: handle spaces in filenames.

Also use some better error checking while initializing the Git repo.
(again, that's ad-hoc measures, waiting for proper exceptions...)