Identifying galaxy groups at high redshift from incomplete spectroscopic data – I. The group finder and application to zCOSMOS