Former foster mom pleads guilty to child endangerment, rape