fix IOError: [Errno 21] for restraint_job is a directory

Signed-off-by: Gowrishankar Rajaiyan <gsr@redhat.com>