Added missing attributes to api search calls:
- Added an argument to the call() method in order to control the auth sharing
- Enabled it only for search. Pulls and pushes were enabled already.
- Grouped a few variable declarations

Docker-DCO-1.1-Signed-off-by: Roberto Hashioka <roberto.hashioka@docker.com> (github: rogaha)
- Ajusted server.go with gofmt

Docker-DCO-1.1-Signed-off-by: Roberto Hashioka <roberto.hashioka@docker.com> (github: rogaha)
Fix die command when monitor returns

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Fix wait on stopped container (after docker restart) + add Unit test for that case

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Merge pull request #3706 from creack/fix_wait_stopped

Fix wait on stopped container (after docker restart) + add Unit test for that case
Merge pull request #3705 from crosbymichael/fix-die-event

Fix die command when monitor returns
This should make all bash-scripts run on pretty much any posix-system (with bash installed ofc...)

Docker-DCO-1.1-Signed-off-by: Kim BKC Carlbacker <kim.carlbacker@gmail.com> (github: bkcsoft)
Merge pull request #3707 from bkcsoft/fix-bash-hashbangs

Update bash shebangs to use "/usr/bin/env bash" for increased portability
Merge branch 'add_missing_attributes' of https://github.com/rogaha/docker into rogaha-add_missing_attributes

Conflicts:
	api.go

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Fix issue with exit code in non-tty mode.

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Merge pull request #3708 from creack/fix_run_exit_code

Fix issue with exit code in non-tty mode.