pal: pass valid pal_device structure to streamDevSwitch function

Passing address of a locally scoped pal_device structure to other
functions will lead to garbage value when dereferenced as the
adrress will not be valid outside the scope.

Fixed this by declaring the structure in the main scope of the
function.

Change-Id: I2e1ea6f0fd22555337f9c51b589e3d898882c9b0
1 file changed