Single-photon linear polarimeter based on a superconducting nanowire array