Use essentially the same OS X code signing script as in libreoffice-4-2

Change-Id: Ica7dcc823cc7027a00b15d2dcf5b73b0ef322189
A few improvements to macosx-codesign-app-bundle

Try harder to handle app bundles with space in name. (Not sure if this
version yet does that 100%.)

Include the directory names in the "ids" to make them unique. There
are lots of files with the same name (in different directories, of
course), especially in an app bundle that includes help in multiple
languages.

Change-Id: I424c539f6389ac6f7c9cef96aeb873ddac459f78