Fix OSX bundle library write permission bug.