Fix platform-specific preferences in some cases

While working with the new platform.local.txt support, I stumbled upon a problem (or at least something unexpected) in the way platform-specific preferences are handled, which is fixed by the first commit. The second commit addresses platform-specific preferences for macosx, which were not working at all AFAICS.