Don't try to write Python bytecode files in case of a read-only installset

It causes annoying messages in the system log in the OS X sandboxed
case.

Change-Id: I8ae3eb34df2c045bdbdfc63cae9007f973c42537