Three-dimensional coupled-wave model for photonic-crystal surface-emitting lasers