Protocol for nearly deterministic parity projection on two photonic qubits