Fix Coverity CID116116 - Untrusted value as argument
Fix Coverity CID116116 - Untrusted value as argument

Check if the length can be < 0 as well.

This is unlikely as we create the messages on a trusted process (our
master), but check nonethless as we check the upper bound.

profusion/lightmediascanner,profusion/lightmediascanner,profusion/lightmediascanner