Energy bounds for codes in polynomial metric spaces