The European Commission has warned Germany that it must change its controversial packaging laws or face the possibility of being taken to the European Court of Justice.