Get the checkout dir the right way

$0 is only realiable when we _run_ the script, not when we source it. It may
work, but on some situations (on a ssh shell) it won't.

This solution is described here: http://stackoverflow.com/a/12473752

Change-Id: Ifbf33769890959a238ba641488e5761a350a36d6