docker: exclude 'entrypoint' from comparing 'command' param with containers

The JSON the Docker API returns includes the container's entrypoint (if it has one) prepended to its `Command` value. So instead of checking if `container['Command'] == module.params['command']` – which will be wrong if the container has an entrypoint – we just check that `container['Command'].endswith(module.params['command'])` so the entrypoint won't affect a container being properly classified as matching the module params or not.

Also I refactored a super-long `if` statement into some temporary variables - I did it to help me figure out what was going wrong, and then it makes the code more readable so I kept it.

(Note that this won't work with the currently-released `docker-py` until #6991 is merged in, because the `docker` module is broken until that happens)