Do os.platform() check only once.