[test] Add test for MED3 loader

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Handle memory allocation errors in MED3 loader

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>