Support committing on a detached HEAD. This fixes failures to amend commits during interactive rebase.