[oneDNN]: Code cleanup
@penpork Thank you very much.


This is a small code-cleanup PR which is specific only to oneDNN kernels. There are no changes to Eigen ops. 

Changes include fixing potential nullptr dereference checks, out-of-bounds memory accesses, removing unused variables etc.