CCD-photometry of galactic globular clusters - III. NGC 6171.