Backport V3 flavor extraspecs API unit tests to V2

This patch backport some of the V3 flavor extraspecs API unit tests
to V2 unit tests.

V2 flavor extraspecs API does not raise HTTPBadRequest error in case
provided extraspecs key is not string. It raise the TypeError instead.

This patch also correct that and raise HTTPBadRequest in such cases.

Change-Id: If73552943a8aa9b714d6748278311e816ec3daf7
Merge "Backport V3 flavor extraspecs API unit tests to V2"