Fix infinite loop when setting internal_quantity

There could be difference for Float field between the written value and the
read one. This could lead to an infinite loop of write calls, so we also test
that it is not already writing the same internal value.

issue3332
review1109002
Add unittest for infinite loop when setting internal_quantity

issue3332
review1109002