Charge detection enables free-electron quantum computation