Accused war criminal Ben Roberts-Smith has been granted bail in a Sydney court after more than a week behind bars.