Structural basis for the substrate specificity of 3-hydroxybutyrate dehydrogenase