Add NNT_static internal tests for device memory allocation.

These tests use a customized IDevice to test the device memory
allocation and fallback logic.

This CL also allows the runtime to dispatch device memory allocation
with dynamic shape to drivers.

Additionally, this CL fixes a bug that a failed device memory allocation
will return BAD_DATA -- it should return OP_FAILED instead.

Bug: 152209365
Test: NNT_static
Change-Id: I1facb2dad345958c3b9b1bab4a9564085c382c4a
Merged-In: I1facb2dad345958c3b9b1bab4a9564085c382c4a
(cherry picked from commit b277b676c319f02b44ef91b330593aac591f4fd3)
6 files changed