ping/ntpq: properly order termination conditions

Signed-off-by: Olivier Mehani <olivier.mehani@nicta.com.au>