Design, construction, and test of the Gas Pixel Detectors for the IXPE mission