Add check for correct phantomjs binary permissions

Our in-house CI system uses karma in a llnux container with an overlay filesystem, and the below chmod causes the 37M phantomjs binary to be copied into the overlay on every test (this consumed 6G of disk in just a few days for us). The fix avoids the chmod unless it's really needed.