api: use SafeBuffer in test related to logging
api: use SafeBuffer in test related to logging

Fixing data race reported by the Go data race detector:

==================
WARNING: DATA RACE
Read by goroutine 132:
  github.com/globocom/tsuru/api.(*S).TestCloneRepositoryRunsCloneOrPullThenPreRestartThenRestartThenPosRestartHooksInOrder()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/api/app_test.go:212 +0x12e3
  reflect.Value.call()
      /var/lib/jenkins/go/src/pkg/reflect/value.go:532 +0x1971
  reflect.Value.Call()
      /var/lib/jenkins/go/src/pkg/reflect/value.go:345 +0xc8
  launchpad.net/gocheck.func·006()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/gocheck.go:709 +0x4a4
  launchpad.net/gocheck.func·004()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/gocheck.go:608 +0xd8

Previous write by goroutine 7:
  bytes.(*Buffer).grow()
      /var/lib/jenkins/go/src/pkg/bytes/buffer.go:98 +0x28a
  bytes.(*Buffer).Write()
      /var/lib/jenkins/go/src/pkg/bytes/buffer.go:121 +0x99
  log.(*Logger).Output()
      /var/lib/jenkins/go/src/pkg/log/log.go:153 +0x432
  log.(*Logger).Printf()
      /var/lib/jenkins/go/src/pkg/log/log.go:160 +0x93
  github.com/globocom/tsuru/log.(*Target).Printf()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/log/log.go:66 +0xd0
  github.com/globocom/tsuru/log.Printf()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/log/log.go:106 +0x86
  github.com/globocom/tsuru/queue.func·001()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/queue/handler.go:45 +0x150
  github.com/globocom/tsuru/queue.(*Handler).loop()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/queue/handler.go:90 +0x47

Goroutine 132 (running) created at:
  launchpad.net/gocheck.(*suiteRunner).forkCall()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/gocheck.go:609 +0x648
  launchpad.net/gocheck.(*suiteRunner).forkTest()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/gocheck.go:717 +0xa4
  launchpad.net/gocheck.(*suiteRunner).runTest()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/gocheck.go:722 +0x3c
  launchpad.net/gocheck.(*suiteRunner).run()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/gocheck.go:564 +0x30b
  launchpad.net/gocheck.Run()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/run.go:65 +0x54
  launchpad.net/gocheck.RunAll()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/run.go:57 +0x197
  launchpad.net/gocheck.TestingT()
      /var/lib/jenkins/.go/src/launchpad.net/gocheck/run.go:45 +0x220
  github.com/globocom/tsuru/api.Test()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/api/suite_test.go:24 +0x32
  testing.tRunner()
      /var/lib/jenkins/go/src/pkg/testing/testing.go:301 +0xe8

Goroutine 7 (running) created at:
  github.com/globocom/tsuru/queue.(*Handler).Start()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/queue/handler.go:50 +0x111
  github.com/globocom/tsuru/app.enqueue()
      /var/lib/jenkins/jobs/tsuru-race/workspace/src/github.com/globocom/tsuru/app/queue.go:165 +0x1b8

==================

ggarnier/tsuru,kgrvamsi/tsuru,ggarnier/tsuru,cgvarela/tsuru,hugoantunes/tsuru,Endika/tsuru,guilhermebr/tsuru,RichardKnop/tsuru,tuxmonteiro/tsuru,hugoantunes/tsuru,ArxdSilva/tsuru,jblancett/tsuru,tsuru/tsuru,Endika/tsuru,gwmoura/tsuru,ArxdSilva/tsuru,kgrvamsi/tsuru,cezarsa/tsuru,hcxiong/tsuru,gciotta/tsuru,jblancett/tsuru,cgvarela/tsuru,tsuru/tsuru,ArxdSilva/tsuru,cezarsa/tsuru,RichardKnop/tsuru,4eek/tsuru,firebitsbr/tsuru,firebitsbr/tsuru,guilhermebr/tsuru,tsuru/tsuru,ArxdSilva/tsuru,guilhermebr/tsuru,4eek/tsuru,mderaldo/tsuru,gciotta/tsuru,mderaldo/tsuru,gwmoura/tsuru,gwmoura/tsuru,cezarsa/tsuru,ggarnier/tsuru,hcxiong/tsuru,mderaldo/tsuru,jblancett/tsuru,kgrvamsi/tsuru,4eek/tsuru,tuxmonteiro/tsuru,tuxmonteiro/tsuru,guilhermebr/tsuru,cgvarela/tsuru,RichardKnop/tsuru,hcxiong/tsuru,tsuru/tsuru,gciotta/tsuru,Endika/tsuru,ggarnier/tsuru,firebitsbr/tsuru,cezarsa/tsuru