taking changes from 1.2 to stop service
Merge branch '1795-fix-pidfile-race'

Patch via Dileep Bapat
https://github.com/dileepbapat/couchdb/commit/f90476074504058c81a6e73814266a5a0724fc55.patch