This is strange.
You can see the commands which mv rc.local to a tmp name and mv it back again later in the kickstart file.
These commands have a unix style, so one would assume that they are executed within a unix style shell, but the presence of ^M's in rc.local suggests they are executed in DOS.
The rc.local file is backed up and the new rc.local file is being created by the %post section of the kickstart file (so not in DOS). The kickstart file itself is created in a temporary directory on the app server then copied to the data store server (pxestore) via nsh. Maybe the ^M's are getting in the kickstart file's %post section and then being added to the rc file that way. The kickstart file is left around in the pxestore directory named after the hex representation of the IP address of the bare metal server (example: C0A80164). Does this file contain ^M's?