utils: add knot_lookup_by_id return checks

refs #2137

Change-Id: I89ef98879e38631a0fc26930edad1e86cabe3151