Fixes #8573. Fix herk- and syrk_wrapper when matrix has a zero dimension.

(cherry picked from commit 47e98d5cfa9c1efae2185d436a669421d0477986)

Add some tests for zero dimensional matrix multiplication in herk- and syrk_wrapper

(cherry picked from commit 687d2b0da6c5e8cff895e8c6f7f8e4b6866b7997)