Don't checkout master when doing checkout --detach

This avoids an error when the git repository doesn't have a master
branch.