[kmf-media-api] improved error handling

Change-Id: I7b1a4b7bd3f3a222634e5fec33c39c12c8a82db2