Your symptoms suggest that you are in early labor. The brown discharge is the spotting observed as the membranes slowly strip and the cervix
dilates. The cramps felt are the uterine contractions that are mainly fundal and as they progress, you can feel them over the entire part. The back ache is due to the cervix dilating. Any urogenital infection can predispose to early labor. The loose stools are due to the release of prostaglandins
in onset of labor. Since you are almost 38 weeks, there is no need for worry about the maturity of the baby. You should see your doctor immediately as you may deliver with relative ease, this being your second delivery. Good luck.