German top court tells two states to pay prisoners better