Add check for NULL in where clause to get_alarm_definition method

Snip alarm definition id from uri before creating link in JSON return body.

Change-Id: I6c93fe5089999b850de3d6c098100abc5094d8a0