Performance of the Gas Pixel Detector: An x-ray imaging polarimeter for upcoming missions of astrophysics