cmd/api: make api check directory per-user

Fixes issue 6353.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://codereview.appspot.com/13652043

Committer: Alex Brainman <alex.brainman@gmail.com>