Production of medium-chain-length polyhydroxyalkanoates from engineered bacteria