fix panic in monitor

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Merge pull request #4723 from vieux/fix_panic_monitor

fix panic in monitor