Mitigation of readout noise in near-term quantum devices by classical post-processing based on detector tomography