[core] Coverity fix issues gated delta net shape infer (#35046)
### Details:
- Fix AUTO_CAUSES_COPY reported by coverity
- Minor refactor of shape_infer function
### Tickets:
- N/A
### AI Assistance:
- *AI assistance used: no*
---------
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>