Fix possible crash if arg is None
Fix possible crash if arg is None

Spotted on dispatcher03 where a bbb job
was left running and a traceback in the scheduler
logs showed that arg could be NoneType, causing
the replace to fail.

Change-Id: Ic105e58a37db0015e756e01d30f54a29e21f8067
(cherry picked from commit 269eba6cfe4d8e8b9a110513fbfcc6c59976b262)

Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server