Take into account container state during lifecycle checks

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>